Create a pidfile before Rails boots

Backport from
https://github.com/processone/resque/commit/7589c2ac1120002e2470e63cca8c
fb82ba973c4d