Use our strnlen on MacOS for backward compat

Apparently MacOS didn't have strnlen on 10.6 and earlier.  To
avoid having linking problems on older versions, we'll just use
our internal version.
Merge pull request #2026 from libgit2/rb/fix-strnlen-on-old-macos

Use our strnlen on MacOS for backward compat