Move pMiningKey init out of StartRPCThreads

This commit decouples the pMiningKey initialization and shutdown from the RPC
threads.

`getwork` and `getblocktemplate` rely on pMiningKey, and can also be ran
from the debug window in the UI even when the RPC server is not running.

Solves issue #2706.
Merge pull request #2716 from laanwj/2013_05_30_getwork

Move pMiningKey init out of StartRPCThreads