Fix app image memory leak

There was a memory leak if we failed to add an image space, this
was caused by releasing ownership without adding it to the heap.

Bug: 22858531

(cherry picked from commit bd064ea2269b23360e32e8139c22d5993ddc385b)

Change-Id: Ib45c0140b82cee5da04ed4a9f101f7c554cb25da
1 file changed