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