readwrite: inlining safe_dump to error checking loop

Signed-off-by: Joe Buck <jbbuck@gmail.com>