Fix memory corruption by changing refs to Objects

The memory corruption is caused by temporary Objects which where
binding to references getting destroyed before they were expected
to. This caused the references to point to corrupted memory.
This fix make the temporary Objects be assigned to Objects instead.

Bug: 66968282
Test: run ./system/connectivity/wifilogd/runtests.sh
Change-Id: If7a14326a663df554a5de9a812422e21b888edf6
4 files changed