internal/lsp/cache: fix leaking wg.Done() and <-ioLimit
internal/lsp/cache: fix leaking wg.Done() and <-ioLimit

There were several returns in this function that could leak both the
wg.Done() and <-ioLimit. This refactors them into defers close to their
counterparts.

Additionally I refactored the function to favor early returns over
nested if statements.

Fixes golang/go#32368

Change-Id: I5357d11ee526c1cb7a6bd1a0f652c61d574c10ab
GitHub-Last-Rev: bfa160b9fd75c4464d2e0a2820c04ddae01de21f
GitHub-Pull-Request: golang/tools#107
Reviewed-on: https://go-review.googlesource.com/c/tools/+/179878
Reviewed-by: Ian Cottrell <52376736e5e84615ec49f9c1843b8acc178b1d8d@google.com>
Run-TryBot: Ian Cottrell <52376736e5e84615ec49f9c1843b8acc178b1d8d@google.com>

golang/tools,golang/tools,golang/tools,golang/tools,golang/tools