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.