Added logic to avoid applying the 'setcap' (the OOM Killer defense)
in Docker environments (e.g. for testing).
Similar to @296666, but that changeg was for upgrade.sh, and this is
for mkdirs.sh.
Info: Using the 'setcap' command on a binary in a Docker container renders
the binary inoperable. Attempts to execute the binary result in
an 'Operation not permitted' error. The workaround: Don't use 'setcap' on
binaries in a Docker container.