replace for loop by while loop

in theory, an rpython for x in range loop should be exactly equivalent
to a while loop. The only difference is if it contains a JIT driver, in
which case the for loop is slower :-(
store None on stack after pop

This allows the object to be freed much earlier (and tells the JIT that
the object that linger on some stack do not actually escape).