Fix jQuery #14381: Sorting cross-document nodes

I'm pretty happy with this, but anything touching `sortOrder` merits an opportunity for objections/recommendations.

```
   raw     gz Compared to master @ c50c710b6411db2cc6d77d3b982ac6625605ea63                                             
  +217    +76 dist/sizzle.js                                                    
   +63    +19 dist/sizzle.min.js
```