Replace getcpy() and strdup() with mh_xstrdup()