Fixes #3649: Move Gentoo mem hooks override to v1.7

---svn-pre-commit-ignore-below---

r28702 [[BR]]
Add memory hooks override for Gentoo sandbox v2.5, too.  Thanks to
Justin Bronder for the patch.

r28708 [[BR]]
Followup from Justin Bronder: Looks like I spoke too soon.  The
sandbox team has informed me that they are getting rid of SANDBOX_PID
in the future and that using SANDBOX_ON would be preferred.