Fix segfault on failure to stat