Use qemu-nbd instead of kpartx
Remove unneeded sleep
Unmount everything at the end