cleanup: reduce scope of variables

Various things caught by cppcheck that are non-critical.

Change-Id: I495453c84bc15788b85036a163ee36b0ac601fa1
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/sensors/sensor.hpp b/sensors/sensor.hpp
index 9ff0584..2c287cf 100644
--- a/sensors/sensor.hpp
+++ b/sensors/sensor.hpp
@@ -11,7 +11,8 @@
 class Sensor
 {
   public:
-    Sensor(std::string name, int64_t timeout) : _name(name), _timeout(timeout)
+    Sensor(const std::string& name, int64_t timeout) :
+        _name(name), _timeout(timeout)
     {
     }