Automatically flush STDOUT

Need to do this otherwise we cannot monitor progress (e.g. with
./script.pl | tee output.txt)