Add TextHeaders.getAndRemove(...)

See #2649 for motivation
It seems that we always add new header before the origin head. If we want return the list ordered by its append time, we need reverse it.