Add trick to bypass ptrace error with gdb

This happens when attaching a process.