Buffer 'setoption' commands until engine done thinking
UCI does not allow setting of options during search after all. So all
'setoption' commands are now first collected in a memory buffer. During
ponder or analysis the search is then stopped immediately to flush that
buffer to the engine, in a new routine Release(). This routine will
also (re)start a ponder search if one is called for. During thinking,
finishing the search has priority. So only Release() the buffer contents
when a search finishes (immediately after receiving 'bestmove').
To deal with race conditions we also flush the buffer in the GUI thread,
after waiting for thinking to finish, just in case.
The WB 'easy' and 'hard' command implicitly set the Ponder option,
and this is treated by the hack of injecting fake 'option' commands in the
input stream, which then are subjected to the same buffering scheme.
Because waiting for thinking termination might now not happen at all
(if we only receive commands that can be handled instantly), a test for
search termination was added immediately after reading the command,
so that every command can now be aware whether thinking is in progress.