This fixes the error in pure evaluation mode, 'fetchTree' requires a locked input when using '--override-input X Y' where Y is an unlocked input (e.g. a dirty Git tree). Also, make LockFile use ref instead of std::shared_ptr.