cli: serve: call fsync(2) before closing the output file

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