lib: cppcheck fixes