fixes for close flush

Signed-off-by: Andy Green <andy.green@linaro.org>