Race condition in finish_unprepare
In finish_unprepare the state_lock is temporarily released. If there is an error message on the pipeline bus received during this the state can change to GST_RTSP_MEDIA_STATUS_ERROR which would result in finish_unprepare prematurely return.