improve Headers.iter

This code is currently used in the servo branch, forgot to make a PR to master.