unix: file: Implement .flush() method.

This method apparently should be part of stream interface.
stream: Factor out mp_stream_write() method to write a memstring to stream.