ENH: use sparse meshgrid instead of indices for ma.sort

reduces memory usage by about 40%