Diff below introduce multiple 'goto fail' in ptrace_ctrl(). It is
extracted from guenther@'s proctreelk diff because it doesn't introduce
any change in behavior. I'd like to get it in to shrink the locking
diff.