Several fixes and enhancements

  1. Change the coinbase check params from global to per-pool;
  2. Add a coinbase total payout amount check param;
  3. Eliminate the possible out-of-range access in several places;
  4. Call disable_pool() at the begin of remove_pool() and combine them when appears together in the code;
  5. Other tiny fixes and enhancements;

Signed-off-by: Huang Le <4tarhl@gmail.com>