TEIID-3074 improving the close check in the non-deterministic case