Fix dangling reference to scan count

count variable is automatic but was captured by reference in the deepest
nested lambda. This makes all the captures explicit in the post-scan
lambdas.

Tested: entity-manager presents the same items before and after this
change.

Signed-off-by: Jonathan Doman <jonathan.doman@intel.com>
Change-Id: I34bce907e43adb67067797c74b2feaf489d742dc
diff --git a/src/EntityManager.cpp b/src/EntityManager.cpp
index 84d68c6..744bcf8 100644
--- a/src/EntityManager.cpp
+++ b/src/EntityManager.cpp
@@ -1832,16 +1832,18 @@
 
                 inProgress = false;
 
-                io.post([&, newConfiguration]() {
+                io.post([count, newConfiguration, &systemConfiguration,
+                         &objServer]() {
                     loadOverlays(newConfiguration);
 
-                    io.post([&]() {
+                    io.post([&systemConfiguration]() {
                         if (!writeJsonFiles(systemConfiguration))
                         {
                             std::cerr << "Error writing json files\n";
                         }
                     });
-                    io.post([&, newConfiguration]() {
+                    io.post([count, newConfiguration, &systemConfiguration,
+                             &objServer]() {
                         postToDbus(newConfiguration, systemConfiguration,
                                    objServer);
                         if (count != instance)