Add changes to ptrace wrappers to fix FreeBSD-related bugs
Mostly fix shared object injection