Previously, Headers.set() validated its arguments only when the header
did not already exist. Existing values were overwritten without
trimming or validating the new value and without checking the immutable
guard. It also detached duplicate values only from the first header's
chain, while leaving the corresponding list entries active. The stale
values could reappear when the Headers object was copied or serialized.
The fix is to move append(), set(), and delete() validation and list
updates into engine-independent helpers, deactivate every duplicate on
replacement, reject empty names, and enforce immutable guards
consistently. Content-Type presence is now derived from the header list
instead of a separate cached pointer.