sort: use memset to initialize structure when possible
(cherry picked from commit f02c783757365340763739e58ef0e68ec13a0f8f)