build-sys: add cppcheck target

This uses --enable=all mode. Should be taken with a grain of salt
though. While many recommendations make sense we should probably keep
"int r" always on function scope, and many of the portability warnings
really don't matter to us because we only care for Linux/glibc.
Fix segv introduced by 2fd069b18e525860514a70d3ea08410ca122d3e2

n->path is pointing to the value now, we set s = NULL above.