Replace `strlen()` with `strnlen()`, and similarly for other `str*` family functions. Inspired by: https://github.com/d-e-s-o/nitrocli/issues/85