Fix clang-tidy performance-* warnings in system/libhidl.

* Use const reference parameter type to avoid unnecessary copy.
* Use more efficient overloaded string methods.
* Use const reference type for loop index variables to avoid unnecessary copy.

Bug: 30407689
Bug: 30411878
Bug: 30413223
Test: build with WITH_TIDY=1
Test: libhidl_test
Change-Id: I1deae1f09d56c2fa9cd56728b13ca50305d18f3e
4 files changed