pud: fix position file stat/use race
pud: fix position file stat/use race

Coverity:
CID 739696 (#1 of 1): Time of check time of use (TOCTOU)
At (1): Calling function "stat(char const * restrict,
                               struct stat * restrict)"
        to perform check on "fileName".
At (4): Calling function "fopen(char const * restrict,
                                char const * restrict)"
        that uses "fileName" after a check function. This can cause a
        time-of-check, time-of-use race condition.

Signed-off-by: Ferry Huberts <66e11f9f5d965b69497c7e73d5e808f8b13c1218@pelagic.nl>

diogomg/olsrd,acinonyx/olsrd,diogomg/olsrd,zioproto/olsrd,sebkur/olsrd,cholin/olsrd,zioproto/olsrd,diogomg/olsrd,zioproto/olsrd,diogomg/olsrd-binary-heap,nolith/olsrd,diogomg/olsrd-binary-heap,ninuxorg/olsrd,sebkur/olsrd,tdz/olsrd,ninuxorg/olsrd,sebkur/olsrd,diogomg/olsrd-binary-heap,acinonyx/olsrd,tdz/olsrd,cholin/olsrd,diogomg/olsrd,diogomg/olsrd-binary-heap,diogomg/olsrd,tdz/olsrd,cholin/olsrd,sebkur/olsrd,nolith/olsrd,ninuxorg/olsrd,sebkur/olsrd,acinonyx/olsrd,tdz/olsrd,tdz/olsrd,zioproto/olsrd,nolith/olsrd,nolith/olsrd,ninuxorg/olsrd,nolith/olsrd,diogomg/olsrd-binary-heap,acinonyx/olsrd,cholin/olsrd,diogomg/olsrd-binary-heap,zioproto/olsrd,sebkur/olsrd,ninuxorg/olsrd,diogomg/olsrd,diogomg/olsrd,diogomg/olsrd-binary-heap,acinonyx/olsrd,cholin/olsrd