Optimize -regtest setgenerate block generation

Speed up generating blocks in regression test mode, by moving
block-creating and nonce-finding directly into the setgenerate
RPC call (instead of starting up a mining thread and waiting for
it to find a block).

This makes the forknotify RPC test three times quicker, for
example (10 seconds runtime instead of 30 seconds, assuming
the initial blockchain cache is already built).
Unused:
```
rpcmining.cpp: In function ‘json_spirit::Value setgenerate(const Array&, bool)’:
rpcmining.cpp:167:13: warning: unused variable ‘nHeightLast’ [-Wunused-variable]
         int nHeightLast = -1;
             ^
```