internal/lsp: move some per-command set-up into a helper
internal/lsp: move some per-command set-up into a helper

Create the 'prepareAndRun' helper to offload some common command set-up
within the command handler. In subsequent CLs, this will be used to hold
all configuration of the implementation, including whether the command
will execute asynchronously, and whether to show progress.

Change-Id: I6d0f072e805dade5c7df37fa5cdf993d397fa717
Reviewed-on: https://go-review.googlesource.com/c/tools/+/288494
gopls-CI: kokoro <2ac7b1f3fa578934c95181d4272be0d3bca00121@google.com>
TryBot-Result: Go Bot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Trust: Robert Findley <9179eee875d1ee628c37fb47d7e749e855ffd21f@google.com>
Run-TryBot: Robert Findley <9179eee875d1ee628c37fb47d7e749e855ffd21f@google.com>
Reviewed-by: Rebecca Stambler <d7cf11e5f299d88ea8348366a9fc4f7c335c3afa@golang.org>
Reviewed-by: Heschi Kreinick <e89ab2b172855aa0ad01c40c4d8a3535a61ac68a@google.com>

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