Work around compilation errors with regards to unsafe blocks on Mono.
Count words until the end of file, rather than until a blank line occurs.
Add adapted barrier-sync example.