buffered chan should flush on close