Clean up local variable usage - Backends

Combines cleanup for mysql, postgresql and rpc

Change-Id: I37b928a669146671c946fc1ccb8e3ef1a27a3891
Merge "Clean up local variable usage - Backends"