kernel/libkern: Add strnlen() (from FreeBSD) and use it.