Wraps exit event.

wait and exit now send a message to the monitor to perform one last
check to the process, before this one fully terminates. The terminating
process waits for the monitor to send a SIGCONT signal indicating the
last check has been performed. If no signal is received after a timeout
(default 10 seconds), we assume the signal was lost, and continue with
the wait/exit anyway.
Wraps main to ensure one final monitoring check.

When main calls return, the wrapper for exit is not called (only the
original exit). However, gcc and clang allow to add a 'destructor' when
main exits with the __attribute__ facility. With this, we ensure that
the process gets a final monitor check before the information is lost.
Move summary to common header.
Change struct tree_info to struct resources_info
Parsing single summaries from stream.