libcore: Change `each_val` to follow new for-loop protocol
auto merge of #6426 : gifnksm/rust/new-iter, r=catamorphism