Add and use XSTRNDUP macro.