ENH: use masked median for small multidimensional nanmedians