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
diff --git a/base/HidlInternal.cpp b/base/HidlInternal.cpp
index 5fae1c4..0ff52ad 100644
--- a/base/HidlInternal.cpp
+++ b/base/HidlInternal.cpp
@@ -96,7 +96,7 @@
         instrumentationLibPaths.push_back(HAL_LIBRARY_PATH_ODM);
     }
 
-    for (auto path : instrumentationLibPaths) {
+    for (const auto& path : instrumentationLibPaths) {
         DIR *dir = opendir(path.c_str());
         if (dir == 0) {
             LOG(WARNING) << path << " does not exist. ";