retain original API to getCurDir() but make it thread-safe