Fix loopjitting

Improve loop arg/ret discovery

Loop-jitting was incorrectly turning local variables into arguments of lifted loop functions when a variable with the same name is used outside of the loop.  This patch improves the overall argument and return value discovery to properly consider the read/write order of variables.  

You could condense all these conditions (untested):
```
if nextrd is not None:
    if nextwr is None or nextwr > nextrd:
      rets.add(name)
```