Network-embedded self-tuning cavity for WDM-PON transmitter