Clean up main.cpp
Make QueryTransformationEngine clean up after itself
Add proper cleanup for hwloc helper