Fix for segfault due to erroneous free() in case of scandir error Failed scan directory

Hello,

I've run into this:

feh -FZYzrD 3 photos/
feh WARNING: Failed to scan directory phoenixPhoto/#recycle: Permission denied
*** Error in `/home/vorburger/dev/git/feh/src/feh': double free or corruption (out): 0x00007fffffffe200 ***

and found that this is because it does free() even when scandir failed, which it shouldn't. With this fix, above doesn't happen anymore.

Please carefully review my diff to ensure I'm not screwing anything up, or rewrite it... this little fun with gdb to pinpoint this and fix is my first C in almost 13 years

Thank you for feh.

Regards,
Michael