try avoid recursion in _tsolve

Before these changes a hash-dependent failure would occur:

didn't have recursive error in drv_types.py doctest
    architecture:       32-bit
    cache:              yes
    ground types:       python
    hash randomization: on (PYTHONHASHSEED=380265779)

did have recursion error:
    architecture:       32-bit
    cache:              yes
    ground types:       python
    hash randomization: on (PYTHONHASHSEED=1110671673)