Fix ptrace log on i386 and include return value

Patch by Matthew Gardiner