Correlating halide segregation with photolysis in mixed-halide perovskites via in situ opto-gravimetric analysis