added implementation of flush

mockfilestream now writes content to file with flush