Witnessing nonclassicality through large deviations in quantum optics