Refactor and simplify miner_thread (no major behavioural changes)

- getwork_wait* stats are now *only* for time spent in get_work
- cgpu_info.new_work has been removed (never used)
- request_work must be called from device management loop before get_work
- get_work initializes nonce to 0 and takes care of getwork_wait* stats
- new hashes_done function handles all behaviours with completed hashes
- new minerloop function implements simplified device management loop using changes above
- miner_thread initializes cgpu and thr before passing control to minerloop
Move cgpu_info and thr_info initialization to main, and ensure all get initialized before starting any threads
Allow device drivers to implement their own minerloop
Core support for managing multiple processors from a single thread
Incomplete (but workable) asynchronous minerloop

- Probably missing a lot of necessary functionality for various FPGAs/ASICs
- Requires very strict (undocumented) driver behaviour
- Cannot be disabled or interrupted for a work restart
- Not fully asynchronous yet
x6500: Working (but incomplete) asynchronous/single-threaded driver
Bugfix: mining_threads is now a total of thr_info objects, not necessarily actual running threads