Replace sys.exits with raises.
Use fsync on state dump

This ensures that the state dump files would be on disk. Otherwise, with
a busy suite on the ext4 file system, they may be left as zero size
files on a power failure.
Merge pull request #813 from matthewrmshin/fsync-state-dump

Use fsync on state dump
Merge pull request #812 from arjclark/fix.hang-on-empty-state-file

cylc-restart: fix getting stuck on loading broken state file