Unarchive should work when parent directory is not writable

Correct unarchive so that the checks for writeability are
sensible.

Added a test for when parent directory is not writable