updated PR: fix bug, add command, drop lock.

update from

https://github.com/eaburns/ptrace/pull/2

which cannot be tracked there because i stupidly went on using tfogal:master for my own purposes.
Nit pick: // error that is pending is returned.
(It only returns one error.)