packer: In the case of an error, close stdout/stderr writers