Bug 730438 - Remove Coverity scan TOCTTOU races from file handling code

There are various places in EDS where Coverity has detected TOCTTOU (Time
Of Check To Time Of Use) races in the file handling code, typically where
we do a stat() and then some other operation (e.g. open()) on the same file.
Apart from using extra syscalls unnecessarily, this approach is prone to
(quite unlikely) races where the file is created/destroyed between the stat()
and the following call. Instead, we should just examine the return value
from the following call more closely, and delete the stat() call.