[#22992] Correction of wrong exit code when testing state.yaml

Related issue: http://projects.puppetlabs.com/issues/22992

I think the previous version mishandled the "case" expression ( `case @proc or @file` ): `@proc` had precedence and always enters the first case.  Because of this `@file` was never evaluated. 

The proposed patch handles status priorities (CRITICAL is more important than UNKNOWN) and removes a typo that existed since the begininng.