Fix EZP-20601: Permission checking error when using object states

Using object states caused a fatal error in the sql query.
Used the previous query from the 4.6 : http://pubsvn.ez.no/doxygen/4.6.0/html/ezcontentobjecttreenode_8php_source.html#l01633