Reorganized monitor hooks to include limits file.
Ensures main process gets wait().

When moving from waitid to the current code, if two signals were sent to
the same process, say sigchild and sigterm, sometimes sigterm would kill
the process, with the code for sigchild never running. The problem was
that the call for wait() was only on the handler of sigchild. Before
this was not a problem, since waitid was called on sigchild only for
debugging purposes, with wait() in the handler for sigterm.
Fixes bug for limits in wall and cpu time.

The times were given by the user in seconds, but they were compared as
microseconds in the resource_monitor.