Fix erroneous behaviour in error cases

Corrects error handling when image creation fails and fixes
shutdown behaviour in error cases.

Change-Id: I29b9fbd237b90f6007e4731d9019efb6b4c256ff
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
1 job for master in 1 minute and 2 seconds (queued for 1 second)
Status Job ID Name Coverage
  Test
passed #6008009
build_vulkan_wsi_layer

00:01:02