task: add function guard for _set_lock() and fix guard for _join()
task: add function guard for _set_lock() and fix guard for _join()

Should only access the object structure after checking
it's valid in gst_task_join().

https://bugzilla.gnome.org/show_bug.cgi?id=746385
https://bugzilla.gnome.org/show_bug.cgi?id=746431

centricular/gstreamer,StreamUtils/gstreamer,krichter722/gstreamer,centricular/gstreamer,krichter722/gstreamer,StreamUtils/gstreamer,krichter722/gstreamer,jpxiong/gstreamer,StreamUtils/gstreamer,jpxiong/gstreamer,jpxiong/gstreamer,StreamUtils/gstreamer,krichter722/gstreamer,centricular/gstreamer,krichter722/gstreamer,StreamUtils/gstreamer,jpxiong/gstreamer,jpxiong/gstreamer,centricular/gstreamer,centricular/gstreamer