Avoid SEGV after an error occurs during a stat() call.