media: release the state lock when going to NULL
media: release the state lock when going to NULL

Set our state to UNPREPARING and release the state-lock before
setting the pipeline to the NULL state. This way, any pad-added
callback will be able to take the state-lock and check that we are now
unpreparing instead of deadlocking.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727102

surround-io/gst-rtsp-server,hsteinhaus/gst-rtsp-server,surround-io/gst-rtsp-server,hsteinhaus/gst-rtsp-server,surround-io/gst-rtsp-server,Lachann/gst-rtsp-server,barisdemiray/gst-rtsp-server,Lachann/gst-rtsp-server,barisdemiray/gst-rtsp-server,hsteinhaus/gst-rtsp-server,Lachann/gst-rtsp-server,thaytan/gst-rtsp-server,thaytan/gst-rtsp-server,thaytan/gst-rtsp-server,barisdemiray/gst-rtsp-server