rustc::metadata::decoder: cleanup and slightly speed up each_path
auto merge of #6946 : Blei/rust/fix-each-path, r=Aatch