fix missing flush of stderr at exit if it was put in buffered mode