Fixes a race condition in CreateNewBlock.
Fixes a race condition in CreateNewBlock.

CreateNewBlock was reading pindexBest at the start before taking the lock
so it was possible to have the the block content not match the prevheader.

(Partial of faff50d129b6d4b9e6397ac989218e83a26ae692)

ghostlander/Testcoin,jlay11/sharecoin,ghostlander/Testcoin,ghostlander/Testcoin,jlay11/sharecoin,jlay11/sharecoin,jlay11/sharecoin,jlay11/sharecoin,ghostlander/Testcoin,jlay11/sharecoin