Cppcheck: fix some reassignments

TODO: src/extensions/surfaces/openqube/gaussianset.cpp needs to be changed.
Indeed, from line 356 there's a wrong use of switch
Moreover indexMO is assigned but not used

Change-Id: Ie69082b43a72f8b138af2feba406a2b935e5bcc6
Merge topic 'cppcheck-fix-reassign' into master

2448f5f1 Cppcheck: fix some reassignments