When exporting the image contents as a tarfile, wait to close stdout
When mock is using systemd-nspawn, closing stdout before the subprocess
exits causes systemd-nspawn to die with SIGPIPE, which makes us
think that finalize.sh failed. Delay the close. A close_stream=True flag
is added to FlatpakBuilder._export_to_stream() to keep the API used
by atomic-reactor the same.