[range] Fixed a bug in join_iterator where joining a const range and a non-const range led to a compiler error (refs #8483).