Address unlikely memleak in zimatcopy interface (#1129)