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

(cherry picked from commit b06e2aa3414d480d8b44459b0632226921be85f6)