core: fix of export without tasks and snapshot collapse

The following patch handles the following issues:
*The loop should be performed for disks relevant to the snapshot only.

*The populated image id's list should contain only exported images.

*When exporting a vm with no created tasks and collapse, the collapse
operations should be done - otherwise we will never have the snapshots collapsed when there are no created tasks.

*The unlock of the vm should be the last step, as otherwise the vm
configuration might change during the run and yield to inconsistent
results.

Change-Id: I1bfc2761a5483d6f0b274d064cbc7e155562573f
Signed-off-by: Liron Aravot <laravot@redhat.com>