Autodetect mecab

Change configure.ac to autodetect mecab unless --with-mecab / --without-mecab
is specified.
Fix crash

Pass the correct length when copying the original value to the new one.