cppcheck: fix Exception should be caught by reference

Add const when it's possible to indicate the arg isn't changed
Remove arg name when not used