Update run as worker to pass SIGTERM correctly to subprocess

The reason we weren't gracefully shutting down before is that bash
won't forward SIGTERMs to processes that are running in the foreground.