python proxy flushes cmd at exit