R600: avoid calling std::next on an iterator that might be end()

This was causing my llc to go into an infinite loop on
CodeGen/R600/address-space.ll (just triggered recently by some allocator
changes).