add flush_at_shutdown option to buf_memory