buffer: create memory_file as a wrapper around the open_memstream API