Fix debugger detection on Linux 3.4 and later
Fix update ordering bug in tree_rewrite_aux