mem: add av_strndup() for duplicating substrings