Grid: prevent potential leak from listener for sort; fixes #393