rdoff: use nasm-provided safe memory allocation and I/O