Remove leak checker (external tools can do this).
Fix issues reported by cppcheck.
Add RAII wrapper around C IO code.