Several trivial source improvements from cppcheck

(None are actual bugs, just style/clarity/scope cleanups)
Avoid unsigned < 0 comparison warnings in conf.c

These warnings crop up routinely in several tools/compilers
due to stupid interpretation of the macro by the tools.
This shuts them up at the cost of yet another ugly macro.
(perhaps these should be turned into proper functions)
Replace asctime_r() with strftime() for html stats output

Pointed out by cppcheck

I don't think this is a real-world issue at this time, but
POSIX did mark asctime_r() obsolete, and there are nagging
theoretical cases about the size of its buffer.
Fix compile error if no RLIMIT_MEMLOCK defined

Found by cppcheck

This is a silly source error: bad placement of a #endif
would result in a C syntax error if anyone ever tried to
compile on a platform that did not define RLIMIT_MEMLOCK
(which is apparently none of our platforms to date?)
s/readdir()/readdir_r()/

Better to be safe than sorry.  Currently, the only users
of readdir() in the codebase are both in the same thread
which makes this a non-issue in practice, but there's no
guarantee that will always be the case, or that 3rd-party
plugins won't want to read directories in their own threads.