test: add in the snapshot read/write tests

These tests currently fail.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
lwt: create files with O_TRUNC

Otherwise we end up with extra junk at the end of our vhds, where
the footer is supposed to be.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Use the correct filehandle when reading a parent vhd

We were looking up the parent filehandle only once, outside the
recursion up the tree. Instead we lookup the filehandles locally
so we're sure we always get the correct one.

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