kern: factor out the 'writing' bits of user process coredumping
Instead of assuming we have a vnode to dump to, pull out the bits that
describe how to write acoredump into a struct coredump_writer; the ctx
in that is expected to be opaque, but used by write/extend functions.
This should not be a functional change- we change two callers to use the
classic vnode write/extend interface.
This opens us up to other possible targets for coredumps, such as a
shmfd.
Reviewed by: markj (earlier version), kib
Differential Revision: https://reviews.freebsd.org/D51337