If stderr is provided, ScriptModules should print errors there

This is needed for the script editor that wants to show errors in its
error screen.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Let ScriptModules flush their output after their done

This is required to make sure that the errors that were printed to
the provided error writer (e.g. in the error panel of the script
editor) are actually shown.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge branch 'scripts'

This topic branch brings fixes required by the script editor (so that
errors are shown in the script editor, not in the console that might
be hidden from the user by the operating system).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>