Better way to avoid unlinking a non-existent file.
Review Request #1438 — Created Dec. 6, 2014 and submitted
This solves a race condition too (although there is still another race),
and is more consistent with similar patterns elsewhere in the file.
Relevant integration tests pass (after cleaning, so this triggers both a failed unlink and a successful one).
Manually tested the relevant code block.