Work around Windows ftell() bug as per Microsoft engineering's suggestion