media: refactor starting and waiting for preroll
media: refactor starting and waiting for preroll

Based on patches from Ognyan Tonchev <ognyan@axis.com>

See https://bugzilla.gnome.org/show_bug.cgi?id=711257

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