When updating fd_cdir or fd_rdir, put the new pointer in place _before_ vrele()'ing the old one, so that you can't catch the process with a vnode with no references.
When updating fd_cdir or fd_rdir, put the new pointer in place
_before_ vrele()'ing the old one, so that you can't catch the process
with a vnode with no references.

Similarly, in checkdirs(), just count the needed releases and do
them all at the end.  (I think I saw this in FreeBSD.)

Original problem encountered by landry@ (yay for backtrace)
ok tedu@ deraadt@

orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars