fix deadlock when run from tests and redis not started
Issue refs #1721: add file name unique check