Enhanced photostability and optical nonlinearity of nickel and cobalt organometallic complexes