Nonlocal response of optical thermal nonlinearity