Implement process daemonizing for JRuby

This code originates in large parts from the Puma webserver.
See https://github.com/puma/puma. It has been slightly adapted
to fit the sidekiq code but is in and by itself mostly unchanged.

Daemonizing has been tested to work on the following platforms:
MRI 1.9.3p0 on Ubuntu Linux 12.04
MRI 1.9.3p448 on MacOS X
JRuby 1.7.4 / JDK 6 on MacOS X
JRuby 1.7.4 / JDK 7 on SmartOS

Testsuite seems „good“ - the failures on JRuby didn't change between commits and MRI is green except for a randomly failing test as reported in #1056