Cppcheck results

Every now and then I like to run CppCheck against Pioneer to see what falls out of the static analysis tree!

Mostly its nonsense but this time I found a couple of bugs and some performance warnings in areas that I also see in profiling... plus a bunch that I don't but are an easy change.

I have tested this (_of course_) but extra eyes and if someone could try it on Linux and see what complains that would be very helpful.

Thanks,

Andy