coredump: move dump_write() and dump_seek() into a header file