There is only one location using PIPE_EVENT_SIGNAL: to synchronize player_command() with player_command_finished(). Use the "notify" library instead of the event_pipe here.
Other libraries may need to access the main_loop reference, to add or remove events, or to call g_main_loop_quit().