Switch from using freopen() to fclose()+fopen() for reopening PST files
This fixes a data loss problem in the readpst parallel jobs support.
glibc since 2.29 and musl both seek before closing the file descriptor.
Since the file descriptor is still linked to the file description created
and still used by the parent process, the seek changes the file position
of the file description of the file descriptor of the parent process,
which means the parent process reads data from the wrong location and
soon encounters errors, stops processing the data and misses out on
processing the messages that occur later in the PST file.
Since sharing a file description between parent and child processes is
inherently unsafe and there may be other C libraries that seek even before
fclose(), this is only a workaround and a different design is required.
Workaround-for: https://github.com/pst-format/libpst/issues/7