cws2fws: Close file handles on error