gopls/internal/lsp/cache: check number of orphaned files after filtering

I noticed redundant "reloadOrphanedFiles reloading" logs in
https://storage.googleapis.com/go-build-log/0b9348fc/openbsd-amd64-72_04342286.log

This is because we were checking for no reloadable files before
filtering out unloadable files, not after. Fix this logic error.

Change-Id: Ib7ad122bb7f96fdf53474c329fac1ec8ec0e1ef3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/499755
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
diff --git a/gopls/internal/lsp/cache/snapshot.go b/gopls/internal/lsp/cache/snapshot.go
index 7e0a9ba..bff3dc1 100644
--- a/gopls/internal/lsp/cache/snapshot.go
+++ b/gopls/internal/lsp/cache/snapshot.go
@@ -1605,9 +1605,6 @@
 			files = append(files, o)
 		}
 	}
-	if len(files) == 0 {
-		return nil
-	}
 
 	// Filter to files that are not known to be unloadable.
 	s.mu.Lock()
@@ -1620,6 +1617,10 @@
 	files = loadable
 	s.mu.Unlock()
 
+	if len(files) == 0 {
+		return nil
+	}
+
 	var uris []span.URI
 	for _, file := range files {
 		uris = append(uris, file.URI())