lib: Fix generic strnlen_user for 32-bit big-endian machines