Treat 'quit', 'force' and '?' commands immediately
The blocking of input during thinking made it also insensitive to 'quit'.
This would cause hanging engine processes when the GUI was closed and would
kill the adapter because it did not respond to 'quit' in time. The Sync()
call that waits for the engine's 'bestmove' is now deferred until after
reading input (executed conditionally through a 'think' flag, so that
it only happens during thinking), so that we can peek at the first command
that arrives during thinking. If it is one of the 'immediate' commands
(?, quit or force), a 'stop' command is sent to the engine before we
start waiting for the 'bestmove', which then never should take long.
Draw offers could potentially arrive during thinking as well, interefering
with this mechanism by eclipsing a following ?/quit/force. As these would
just set the drawOffer flag for processing during the next move, these
are now fully processed immediately.