Add getunconfirmedbalance() RPC call, fix balance calculation.