Fix a few cppcheck findings

This is a fixed version of https://github.com/RIOT-OS/RIOT/pull/1435