Implemented zstrndup.