Fix StackOverflowException in main
Fix StackOverflowException in main

The exception handler in main prevents the recursive function from being
tail-recursive. As a result a StackOverflowException occurs regularly.
main now instead contains a while loop, and a mutable state variable.

cloudRoutine/FsAutoComplete,kjnilsson/FSharp.AutoComplete,rneatherway/FsAutoComplete,cloudRoutine/FsAutoComplete,vasily-kirichenko/FsAutoComplete