[FIXED JENKINS-23683] Check whether war's directory is writable

As we cannot assume in-place editing of the war file (in fact it's not what happens), be extra careful and check both the file's and its parent dir's write permissions.