Actually write out the header, not just the parent locators

This fixes part of the unit test, but exposes an I/O problem.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
lwt: define reads and writes of 0 bytes as valid

Previously we always considered a read or write which returned 0
as having returned short, triggering an End_of_file, even if we
actually requested 0 and the call succeeded.

This fixes the broken unit test.

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