TGitCache: Make sure keys are not empty and paths do not end with backslash