sort: replace malloc+memset with calloc
(cherry picked from commit ecc3c2916751a0aef5619ed8f0ba1cc37c0a22ba)