TST/API/BUG: resolve scoping issues in pytables query where rhs is a
             compound selection or scoped variables

             e.g. 'l1=selection.index' and 'l1=l', where l = selection.index
                  were failing