In N32 ABI, 8-bit or 16-bit integers should be extended following the
signedness of the integer, but 32-bit integers should always be
sign-extended to 64-bit (note that N32 ABI only works on 64-bit CPUs).
So handling this in everything using libffi would be nasty. And the
libffi code for architectures with a similar rule (LoongArch & RISC-V)
also properly handle this. Let's do this work in libffi for MIPS N32
too.
This fixes two failures in Python 3.12.1 ctypes test.