fix MacPython / pandas-wheels ci failures
https://github.com/pandas-dev/pandas/pull/25483#issuecomment-469366672

@jreback : the regex is getting a bit unreadable.. this may suggest that a more (user friendly|consistent) error message should be raised by `safe_sort`?