11x geot 4792

Backporting of GEOT-4792: optimizations in JDBCDataStore ensureAuthorization