Fix `xmemdup` function signature