Add TextHeaders.getAndRemove(...)

See #2649 for motivation
Sounds good to me. Let me handle it in another commit.