options: support setting NumRewriteThreads

Support setting NumRewriteThreads and NumExpensiveRewriteThreads.

This means moving a bunch of thread-related code from apache/ to system/. While we're at it, also move handling of use_per_vhost_statistics, install_crash_handler, and rate_limit_background_fetches to system/ so they're no longer duplicated between nginx and apache.

I also partly cleaned up the way we handle options that are set on the factory, getting the duplication out of apache/ and nginx/ and moving the code into system/.