A rather considerable set of changes which started as a bug fix before turning
into quite a major re-work. A brief summary of the changes are as follows:
1. Fixed bug involving (potentially) writing past the end of an array. The
search PV arrays can contain up to SEARCH_MAXPLY moves. However check (or other)
extensions could push the search deeper than SEARCH_MAXPLY. Fixed this by adding
a simple check for the ply being too great. In this case we simply do a qsearch
and return. This should be a safe enough fallback for the rare cases it matters
(it will, by definition, by far from the root).
2. Fixed rare threading bugs causing things such as crashing when quitting, and
also to potentially process the 'position' and 'go' commands in the wrong order
(i.e. searching on the previous position, desite receving a more recent
'position' command). I did not look into what caused these exactly, as the fix
for this was to simply completely change and re-write the whole logic regarding
input handling and threading.

However to accomodate these changes a lot of other code needed to be changed
(read: improved), hence the rather large commit. The upshot of this is that now
it should be easier to work on the engine, especially towards a parallel search.
Fixed bug where a pointer in the board struct wasn't properly updated in SetBoardFromFEN().