Backport passing Resque::Worker object to before_first_fork hook

We are actively using this bit of code so I think we should merge it into our branch (I have a bit more cleanup coming too).

/cc @rtomayko @wfarr