Writing larger files fails on Windows. fix #1281