test: add utility functions for creating temporary block devices

We use 'dd' and 'losetup' to create block devices which are safe to
play with (this avoiding touching any system-critical devices)

Signed-off-by: David Scott <dave.scott@citrix.com>