fix cppcheck errors and tools warnings, SConstruct
fix memory leak, use ggdb3