lazy: handle eof case for fold/mapfold to flush acc value