(#21320) Use sleep in the daemon loop instead of select

This fixes a bug on Ruby < 2.0 where the daemon might sleep for a very long
period after being interrupted with a signal. The implementation of select on
these ruby versions has an improper cast which resulted in a corrupted value
given to select on 64 bit systems. It is patched in Ruby 2.0 in
https://github.com/ruby/ruby/commit/b10c3136b0163536a679b10fecbc2992f3b5fa64 .

Sleep does not attempt to restart after being interrupted and does not have this bug.