this implements strnlen for klibc