[Bug 457034] Improve handling of swap files