Quantum relaxation and metastability of lattice bosons with cavity-induced long-range interactions