AGENTS-102 - Gracefully handle SIGTERM signals

We need to handle `SIGTERM` signals and allow work to complete.
See https://clever.atlassian.net/browse/AGENTS-102 for details.

I don't think we need more tests than the signal test - we don't change much about the worker. Feel free to disagree, though :)