ext-array.c: Ensure that fseek is called before switching between read and write.
ANSI C requires that a file positioning function (eg seek) occurs before a switch
from reading to writing a stream (or vici-versa). We had not been doing this.
This had caused problems which manifested themselves on Windows operating systems,
by mysteriously failing to write the stream (and thus truncating the datafile).
This change corrects this.
Thanks to Harry Thijssen and Henry Gong for their very valuable assistance tracking
down the cause of this problem.
Reviewed-by: Ben Pfaff