Set rlimits in the Application class (rather than in the init script).

Fixes #5260