It isn't necessary to check for permission to modify a WIM for in-memory
operations such as wimlib_add_image(), wimlib_update_image(), and
wimlib_delete_image(). It is only when the user attempts to modify an
on-disk WIM file using wimlib_overwrite() --- or when the user explicitly
opens an on-disk WIM file for write access --- that write permissions
need to be checked.
This change prevents the library from getting in the way of "unusual" use
cases, such as making last-minute changes to a WIM before extracting it
even when the underlying file is located on read-only media, which
otherwise are fully supported by the existing code.
Also part of this change is the removal of can_delete_from_wim(). This
function did a lot of work (decompressing each metadata resource) that
usually turns out to be a waste of time. And it turns out that it really
needs to be called for any 'wimlib_update_command', including "add" and
"rename", because both "add" and "rename" can cause files to be deleted
(specifically, replaced). But this is gone too far. Instead, just get
rid of can_delete_from_wim() completely: it's not needed if we retain
0-reference streams when not recalculating reference counts as part of
wimlib_write() anyway.