Don't forever sleep, because that's stupid and you expose yourself to a race condition (when you've entered the loop but before you've slept) that will hang you.
Merge pull request #3 from dlind/daemon

Prevent the build stage from getting stuck