Preserve the region order when flushing a RegionSet

Related to limetext/lime#341.
As `i` is constant in this whole loop, let's break it out into a separate function. Perhaps with signature:

```go
func (r *Region) merge(others []Region) (resliced []Region, changed bool)
```