tests: Move alarm(2) calls to the correct place in the tests.