Fix with_mem_writer.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>