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.
based on the comment above, a `null` check instead of size check