[ruby/rack] Only add before_fork in multiple workers (#10146)
Fix the following warning:
Warning: The code in the `before_fork` block will not execute in the
current Puma configuration. The `before_fork` block only executes in
Puma's cluster mode. To fix this, either remove the `before_fork`
call or increase Puma's worker count above zero.