Use milliseconds for representing time
Remove swap used and add total/free for both memory and swap
Return the proper status of the process
Atomically print each line

In this way errors occurring at the end due to synchronization between
the tracer function and the process termination do not compromise the
output.