Prevent a crash while closing the output o_stream