init: Fix initialisation crash

Fix a case where initialisation fails without setting
the passed-in GError and the caller assumes it will be
set, and add a guard to catch the condition in case it
happens again in the future.

Part-of: <gstreamer/gst-editing-services!218>
29 jobs for !218 with backport-mr-217-into-1.18-init-crash in 30 minutes and 55 seconds (queued for 9 seconds)
detached
Status Job ID Name Coverage
  Build Docker
passed alpine amd64 manifest builder docker #5730500

00:00:31

passed android docker #5730499

00:00:16

passed cerbero fedora amd64 docker #5730497

00:00:34

passed fedora amd64 docker #5730496

00:00:14

passed gst-indent amd64 docker #5730502

00:00:22

 
  Preparation
passed gst indent #5730505

00:00:11

passed manifest #5730503
manual

00:00:28

 
  Build
passed build cerbero cross-android universal #5730522
gstreamer

00:09:14

passed build cerbero cross-ios universal #5730530
gst-ios-13.2

00:28:04

passed build cerbero cross win32 #5730524
gstreamer

00:06:23

passed build cerbero cross win64 #5730527
gstreamer

00:06:44

passed build cerbero fedora x86_64 #5730521
gstreamer

00:04:44

passed build cerbero macos x86_64 #5730529
gst-macos-10.15

00:10:17

passed build clang fedora x86_64 #5730512

00:06:55

manual build msys2 #5730518
docker windows 1809 allowed to fail manual
passed build nodebug fedora x86_64 #5730507

00:05:42

passed build static fedora x86_64 #5730508

00:05:58

passed build static nodebug fedora x86_64 #5730510

00:03:47

passed build vs2017 amd64 #5730514
docker windows 1809

00:10:05

passed build vs2017 x86 #5730516
docker windows 1809

00:10:16

 
  Test
passed check fedora #5730531
gstreamer

00:06:07

passed integration testsuites fedora 1/4 #5730532
gstreamer

00:12:25

passed integration testsuites fedora 2/4 #5730533
gstreamer

00:13:38

passed integration testsuites fedora 3/4 #5730534
gstreamer

00:13:04

passed integration testsuites fedora 4/4 #5730535
gstreamer

00:14:03

passed valgrind ges #5730536
gstreamer

00:09:35

 
  Integrate
passed cross-android universal examples #5730537

00:06:23

passed cross-ios universal examples #5730539
gst-ios-13.2

00:01:30

passed documentation #5730538

00:16:25