[CORE] remove usage of Directory#fileExists

This commit removes the usage of #fileExists which has been
deprecated long ago an can be a source of race conditions.
Delegate write.lock to primary directory
[STORE] Remove special file handling from DistributorDirecotry

This commit removes all special file handling from DistributorDirectory
that assigned certain files to the primary directory. This special handling
was added to ensure that files that are written more than once are essentially
overwritten. Yet this implementation is consistent all the time and doesn't need
this special handling for files that are written through this directory. Writes
to the underlying directory not going through the distributor directory are not
and have never been supported.

Note: this commit also fixes the problem of adding directories to the distributor
during restart where the primary can suddenly change and file mappings are by-passed.

Closes #8276