Apply write permissions on the pack file.

As permissions are usually applied after file creation, truncating or
writing will fail on AmigaOS if read only permissions are set, as for
some filesystem a permission change will have an immediate effect also
on already opened files.
Implement the write_at() function also for the NO_MMAP case.

The emulation will not work for writable permissions on shared maps.
Don't call p_ftruncate() when no mmap is used.

It is not necessary and also has some problems on AmigaOS when using RAM:.