afpd/volume: don't leak vol_mname in afp_openvol

Reported as Coverity by CID #201201
afpd/hash: avoid use after free in main in case of OOM

Reported by Coverity as CID #968574, #968575.
afpd/fork: avoid use after free on of_closefork error

Reported by Coverity as CID #201311.
afpd/fce_api: avoid null pointer dereference

Move path NULL check before it is actually referenced.

Reported by Coverity as CID #968570.
libatalk: Fix a couple of issues in ad_openat()

Reported by coverity as CID #762151, #762127.
cnid_metad: avoid out of bounds read

The check of i < MAXVOLS should be moved before referencing srv[i].

Reported by Coverity as CID #762114.
afpd: fix out of bounds write

Reported by Coverity as CID #762111.
afpd/acls: fix dereference before null check error

Reported by Coverity as CID #968569.
afpd/hash: return error if we can't allocate the hash

Instead of possible dereference of null.

Reported by Coverity as CID #968565.
Merge pull request #15 from xrmx/coverity1

Fix some issues reported by Coverity scan
Merge pull request #16 from xrmx/coverity2

More issues reported by Coverity
bundled libevent2 is static
Merge pull request #17 from hat001/staticlibevent

bundled libevent2 is static
systemd service file use PIDFile and ExecReload

Add --with-lockfile=PATH configure option for specifying an
alternative path for the netatalk lockfile.

Implements FR #70.
afpd/file: fix memory leak

Reported by Coverity as CID #201194.
afpd/filedir: fix memory leak

Reported by Coverity as CID #201196.
afpd/colume: fix a couple of memory leaks

Reported by Coverity as CID #201199, #201200.
cnid_dbd: fix resource leak

Reported by Coverity as CID #968567.
afpd/directory: avoid unitialized pointer read

Initialize fullpath to null so that in case of error before its
allocation we don't call bdestroy on random memory.

Reported by Coverity as CID #201284.
libatal/vfs: stats a path before checking if it is a directory

Reported by Coverity as CID #201301.