This patch adds the `strnlen_s` function from Annex K. In order to reduce duplication between `strnlen` and `strnlen_s`, the common logic has been extracted to a new internal function which both now call. In addition to the function definition, the patch adds a unit test and a fuzzing test.