Print to stderr after flushing stdout
In some case, you can get the error message before the greeting message. Let's flush stdout
before writing an error message to avoid confusion when reading the output.
Fixes #413 (closed).
Edited by Matthieu Schaller