strnlen polyfill.