Assertions or crashes under _takeViewSnapshot when restoring windows