cppcheck performance fixes in addons/

This issue fixes performance issues in the addons/ source dir. Other paths will probably follow in the future.