Listen for SIGINT/SIGTERM in test containers

The containers we start for a lot of our tests just run a simple loop:

  while :; do sleep 1; done

That loop doesn't care about SIGTERM, so all `docker stop` operations would
take 120 seconds (the timeout before we SIGKILL the container).

Instead, change to this loop, which respects SIGTERM and exits nicely:

  trap 'exit 0' SIGINT SIGTERM; while :; do sleep 1; done

This speeds up all tests that explicitly wait for a container to stop.