For compat32, emulate the same wraparound check as occurs on the real
ILP32 system.
Reported by and discussed with: asomers
PR: 230162
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D16525