lib: Fix some names from previous commit; couple more helpers.
run-tests: Print "TIMEOUT" instead of "FAILED" when a timeout occurs.

Also, cancel the alarm when the test finishes.