glthread: clean up debug_print_sync code