x265: Fix a deadlock when failing to create the x265enc.

The GST_ELEMENT_ERROR will call the gst_object_get_path_string and
use gst_object_get_parent to get the full object path name, which
needs to lock the object. But we are already in a locked context and
so this will cause a deadlock, the pipeline can not exit normally.

Part-of: <gstreamer/gst-plugins-bad!2460>
29 jobs for !2460 with backport-mr-2451-into-1.18-x265_deadlock in 28 minutes and 26 seconds (queued for 6 seconds)
detached
Status Name Job ID Coverage
  Build Docker
passed alpine amd64 manifest builder docker #12618819

00:00:33

passed android docker #12618818

00:00:30

passed cerbero fedora amd64 docker #12618817

00:00:36

passed fedora amd64 docker #12618816

00:00:32

passed gst-indent amd64 docker #12618820

00:00:41

 
  Preparation
passed gst indent #12618822

00:00:31

passed manifest #12618821

00:00:22

 
  Build
passed build cerbero cross-android universal #12618831
gstreamer

00:08:39

passed build cerbero cross-ios universal #12618835
gst-ios-14.3

00:22:56

passed build cerbero cross win32 #12618832
gstreamer

00:05:20

passed build cerbero cross win64 #12618833
gstreamer

00:05:39

passed build cerbero fedora x86_64 #12618830
gstreamer

00:05:23

passed build cerbero macos x86_64 #12618834
gst-macos-11.1

00:15:37

passed build clang fedora x86_64 #12618826

00:11:15

manual build msys2 #12618829
docker windows 1809 allowed to fail manual
passed build nodebug fedora x86_64 #12618823

00:10:44

passed build static fedora x86_64 #12618824

00:10:39

passed build static nodebug fedora x86_64 #12618825

00:07:19

passed build vs2017 amd64 #12618827
docker windows 1809

00:09:35

passed build vs2017 x86 #12618828
docker windows 1809

00:09:24

 
  Test
passed check fedora #12618836
gstreamer

00:08:47

passed integration testsuites fedora 1/4 #12618837
gstreamer

00:09:13

passed integration testsuites fedora 2/4 #12618838
gstreamer

00:10:27

passed integration testsuites fedora 3/4 #12618839
gstreamer

00:10:31

passed integration testsuites fedora 4/4 #12618840
gstreamer

00:09:26

passed valgrind bad #12618841
gstreamer

00:08:15

 
  Integrate
passed cross-android universal examples #12618842

00:05:42

passed cross-ios universal examples #12618844
gst-ios-14.3

00:04:20

passed documentation #12618843

00:13:56