Fix EZP-22333: SQL error in tagcloud with object state policies

Backport of the same fix from ezdemo
Merge pull request #29 from ezsystems/ezp-22333_tagcloud_fatal_objstates

Fix EZP-22333: SQL error in tagcloud with object state policies