Dynamics of thermally induced optical bistability