Normalize an array of spans.
The input spans may overlap and may be non contiguous. The normalized spans are new spans that must be freed.