Environment-Induced Reversible Modulation of Optical and Electronic Properties of Lead Halide Perovskites and Possible Applications to Sensor Development: A Review