Improve handling of spamassassin state files