Improve/Cleanup ptrace wrapper and remove dependency on user.h

Patch by Ashok Thirumurthi.