metadata: Check g_stat result
The g_stat
result is not checked currently. This might lead to the
"Conditional jump or move depends on uninitialised value(s)" errors
detected by the valgrind tool. Let's check the result first before
using the statbuf
data.
Fixes: #733 (closed)