Fix issue with tell() raising exception when outputting to stdout in Windows.