BUG: union should not try to sort inplace because platform impls differ as to when sorting occurs for objects that cannot be compared

closes #5039