Allow symlinked directories to be registered. We already allow symlinks in the parents of the registered directory, so we might as well allow the symlinked directory itself to be registered. Also centralized the logic for checking that a path is indeed a directory. This allows us to get rid of another Lstat call.