Dynamics and stability of cw and pulse lasers in Kerr optical media with K-photon absorption