Make sure the callback dies on SIGTERM.

WEBrick ignores TERM, which we don't want.

Also added more robust termination to the test script.