Added second check to write rights.

(Because on some hosts is_writable() is not reliable.)