Fixes mkdir

I think.  We should be passing DMDIR in the perms argument.  Also, this
tries to catch issues with nasty "mode"/permissions from userspace.
Fixes remove bug

Inferno has this annoying habit of assuming a dev type == 0 means "do a
noop on close".  Devroot used to be the first in the devtab, but we
can't guarantee that since devtab is built by the linker.
QTFILE isn't 0...

This might cause some bugs, but I can't stand when we use the value 0
for a bit.  You can't tell the difference between no type and QTFILE.
Devroot fixup

There's a lot of changes, especially with gen.  There are also some bug
fixes that aren't as big of a deal.  Gen is usually the hard part.