prevent using Tomcat user when setting directories permissions

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.2+
| Fixed tickets | #3013