rpc: remove unused getbalances() code
Summary:
The obj local variable is not used until the end of the scope.
This is a backport of Core PR18459
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D8893