Kill test process only after on_exit runs

We do this to avoid links created during the test from
crashing when the test exits which happened before the on_exit
callbacks run.

This was particularly troubling with GenServer, GenEvent
and Supervisor, in which the first does not crash when
a linked process exits with normal reason, but the other
two do. Due to this behaviour, before this change there was
a possibility of race conditions causing tests to crash on
on_exit.

In case the test process exits with a non-normal reason,
all links will be broken, so the problem doesn't manifest
in such cases.