First order optical phase transitions in photorefractive coherent oscillators