Fix/process on exit

#5 describes the rationale for these changes.

The main issue is that `Process.on_sigchld` does not call the `on_exit` callback.

Note: some changes at not directly related to #5 and will go in separate branches.