Fix improper usage of xmallocz in charset.c