The default behaviour of RPC 'getbalance' is to exclude unconfirmed wallet transactions in the balance calculation.
There exists an additional RPC command 'getunconfirmedbalance' which returns only the sum of incoming unconfirmed transactions.
This patch adds an 'unconfirmedbalance' field to getwalletinfo, reducing the need for additional RPC queries. The functionality is equivalent to 'getunconfirmedbalance'.
I have tested this patch on testnet and it works as expected.