conditionally build strnlen if needed.

it is only used by strndup

prodded by Sortie@