[lsp] fix tracking of open files on didClose
[lsp] fix tracking of open files on didClose

Summary:
the LSP process keeps track of the open files and current buffer, so that if the server restarts, we can get it back up to speed.

however, it was not removing those opened files' state when the files were closed. so if the server restarts, the LSP process tells the server about all the "opened" files even including the closed files.

this leads to stale errors in those closed files: it's actually showing "live" type errors for the outdated buffer that we still think is open. thankfully, it doesn't spread to any other files because live type errors only impact the current file.

reopening the file would update the buffer, but if you changed revisions and the file no longer exists, then you can't reopen it. `flow stop` didn't help because that only restarts the server, not the LSP process. however, using `flow-for-vscode`, the `Flow: Restart Client` command restarts the LSP so that would've cleared the bad state.

the fix is simple: clear out the state when we receive the `didClose` notification.

Changelog:

- fix(lsp): Fixed a bug in which stale errors could continue to appear in the IDE if the errors were fixed outside the IDE (e.g. by changing revisions).

Reviewed By: nmote

Differential Revision: D20684757

fbshipit-source-id: c5a4451d7a49038081810b96f47aa1f823cc0ce8

facebook/flow,mroch/flow,facebook/flow,facebook/flow,facebook/flow,mroch/flow,facebook/flow,mroch/flow,facebook/flow,mroch/flow,mroch/flow,mroch/flow,mroch/flow,facebook/flow