Do not segfault in libclassad if there is no state. #3910
(cherry picked from commit 35cc8abb1979b8caf3bc9b1116fab60197015c2b)
Merge branch 'V8_0-branch' into V8_1_2-branch