Bug correction in stop & resume facility

Added flush when the resume file is written to guarantee that resume
data have been saved