MODE-2173 Fixed the checking of READ permissions for nodes retrieved from queries. This is a similar fix as the one from the 3.x branch, but it's not fully functional because the fact that the query result iterators rely on Batch & Sequence makes it impossible atm to correctly implement them taking into account JCR permissions.