Handle pause play teardown

gst_element_set_state() is asynchronous. You probably should follow it with a synchronous version of gst_element_get_state() to make sure the state transition completes. Or add variants of IsPaused() for all states and call those.