Lazy Thread Creation

MSP-11605

While working on #4189 it was discovered that `rake spec` spawned 30238 threads:
![screen shot 2014-11-06 at 11 23 10 am](https://cloud.githubusercontent.com/assets/2230482/5072319/418208a6-6e3e-11e4-9949-60a0d4fe1a76.png)

It was a hypothesized that most of these threads are unnecessary because they are spawned for parts of metasploit-framework that are not used during `rake spec`, such as the session management threads.

By adding a break point to the `Thread.new` monkey patch used in #4189 to record Thread's `caller`,  I was able to find when Threads were being spawned unnecessary right when `Msf::Framework.new` was called.  This included threads from `Msf::Framework#threads`, which spawns a monitor thread to just monitor other threads; from `Msf::Framework#sessions`, which spawns a monitor thread and a pool of 5 threads to manage sessions; and `Msf::Framework#db`, which spawned a thread when starting `framework.db.sink`, which was actually obsolete.

To stop all these threads from being spawned unnecessarily during tests, I moved to `Msf::Framework#db`, `Msf::Framework#threads`, and `Msf::Framework#sessions` being initialized lazily instead of in `Msf::Framework#initialize`.  Since this is all dealing with threading, the lazily initializer attr_readers needed to use `MonitorMixin`'s `synchronize` so that multiple threads trying to access any of the lazy attributes didn't initialize multiple copies.

`Msf::Framework#threads` was tricky because it is assigned to `Rex::ThreadFactory.provider` in `Msf::Framework#initialize`, which requires a `spawn(name, crit, *args, &block)` interface, so I had to wrap `Msf::Framework` in `Metasploit::Framework::ThreadFactoryProvider`, which supplies this interface, but only called `framework.threads` on the first call it `Metasploit::Framework::ThreadFactoryProvider#spawn` so either direct access to `framework.threads` or `Rex::ThreadFactory.spawn` triggers the initialization of `framework.threads` and the monitor thread for `Msf::ThreadManager` to be started.

For `Msf::Framework#db`, the obsolete `Msf::DBManager#sink` was just removed, in #4205.

# Pre-verification Steps
- [x] Merge #4189
- [x] Merge #4205 

# Verification Steps

## specs

### Thread count before is ~30000
- [x] `git checkout b17b263`
- [x] `rake spec`
- [x] `grep "BEGIN Thread.new" log/metasploit/framework/spec/threads/suite.log | wc -l`
- [x] VERIFY line count is 30294, which is the thread count.

## Thread count after is 1
- [x] `git checkout limhoff-r7-feature/MSP-11605/lazy-thread-creation` (`git checkout 33b4238`)
- [x] `rake spec`
- [x] VERIFY no failures
- [x] `grep "BEGIN Thread.new" log/metasploit/framework/spec/threads/suite.log | wc -l`
- [x] VERIFY line count is 1, which is the thread count.

## cucumber
- [x] `rake cucumber`
- [x] VERIFY no failures