change temporary workaround to permanent fix.

According to Howard Hinnant, in use cases like ours you
need to call file->sync() to synchronize the internal ifstream
buffer with the file.

See http://stackoverflow.com/questions/19558376/clang-3-3-xcode-libc-stdgetline-does-not-read-data-after-calling-ifstream