Backport clang fixes

This pull request almost aligns CMSSW_7_2_X with CMSSW_7_2_CLANG_X, this should make the clang static analyser and the root build even happier. gcc builds should not be affected by any of the changes, since they are all protected by an ifdef. As agreed with @VinInn we should find a better way to avoid capturing VLAs in lambdas (eventually getting rid of the VLA itself, since it did not make C++14).