Fix a couple of unit test typos

There were two cases in rpcapi unit tests where it was checking method instead
of rpc_method.  Fix up the typo and the reason why the typo didn't matter
before.  Also fix two places where rpcapi code had a return for a cast(), which
is now caught by the unit tests.

Closes-bug: #1272518
Change-Id: Ib5e3a002f6b0f7eb8dee8bd84bd53dbf817017f7
Merge "Fix a couple of unit test typos"