Add explicit flush to build.py for Python 2