[misc] fix a crash when scanning a DD image with no UFD plugged in

* Also set the block size to 512 when scanning MBR and PBR
* Closes #352
[core] improve handling of DD images and formatting task order

* Add logic to mount/remount a DD image if it contains a partition we can handle
* Clear GPT structures before copying DD image in case it doesn't overwrites them
* Add a call to refresh the drive layout after copying a DD image
* Move the unlocking of logical drive further down. This may help with the
  infamous "device in use by another process" error.