Improve mining protocol JSON-RPC 2.0 compliance

Improve mining protocol JSON-RPC 2.0 compliance (according to http://www.jsonrpc.org/specification) in the error handling aspect and, as a result, MinerGate pool compatibility.

JSON-RPC 1.0 -like error handling is still supported for compatibility with current cryptonote-node-pool (JSON-RPC 2.0 compliance patch for cryptonote-node-pool is pending).
Proposed JSON-RPC 2.0 error codes are fully compatible with MinerGate implementation of the CryptoNote/CryptoNight mining protocol (which is strict JSON-RPC 2.0).