unixfs build fixes

Hi, I made some small fixes to the unixfs build to let it work with clang and took the chance to kill the only real bugs that were found by the static analyzer. I didn't touch the other filesystems outside of unixfs so it's a little inconsistent.
The ufs driver has been indispensable for sharing a disk with FreeBSD.