lib: add generic strnlen_user() function
lib: Fix generic strnlen_user for 32-bit big-endian machines