sparse_dd: flush and close the log at the end

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