Internal: deduplicate useful headers that get copied from REST to transp...

The useful headers are now stored into a `Set` instead of an array so we can easily deduplicate them. A set is also returned instead of an array by the `usefulHeaders` static getter.
not sure I'd like having `null` here and the `null` check. It also means we have to add back the `synchronized` to the `addUsefulHeaders` to make sure the lazily init works and check again for `null` there.