Streaming writes for 'mprof run'

Memory usage measurement are written to file directly, without waiting
for the monitored process to finish. This has several advantages:

- mprof memory usage is constant (no in-memory storage of measurement)
- allows for some basic on-line monitoring (using 'tail -f' on profile
  file)
- When the child process is killed, every measurement taken so far are
  accessible (which was not the case before)