emulate flush_headers() for python 3.2