image-partition: add unlock() in the error paths
image-partition: add unlock() in the error paths

Earlier commit added image locking around the partition handling. Yet we
forgot to unlock in the error path - fix that.

v2: use defer - this may lead to File.Close() being called twice, but
internally golang is smart enough to only call `man 3 close` as needed

Fixes: 1002e0a ("image-partition: Minimize the image lock scope")
Signed-off-by: Emil Velikov <f20878473f414da183da19ee25c8722cc1d711e4@collabora.com>

go-debos/debos