gstelement: fix deadlock in gst_element_add_pad() when >=PAUSED
gst_element_add_pad() is supposed to activate the pad if the element state is >= PAUSED and the pad is not already active.
Unfortunately, before this patch, the activation was performed while the
element lock was still taken, which ended causing a deadlock in
gst_pad_start_task() as it attempted to post stream-status
message in
the element, which also requires the element lock.
Elements could work around this bug by activating the pad manually before adding it to the element.
This patch fixes the problem by performing pad activation only after the element lock has been released.