cpp: use CHECK* macros instead of debug_*