Do not segfault in libclassad if there is no state. #3910
(cherry picked from commit 35cc8abb1979b8caf3bc9b1116fab60197015c2b)