launch: appliance: Fix a double-free if kernel linking fails (RHBZ#983218).

This also simplifies the code which takes the building_lock around
guestfs___build_appliance.

Thanks Attila Fazekas for the detailed bug report.