XCOMMONS-568: Save status file only if valid

(cherry picked from commit 44241dbc994c2048c007a9fdce83863bd95e8bc6)