This is an attempt to fix the crash at startup on Windows and OS X.
The crash may be caused by a stack overflow when the first rewarded signer is calculated because it's a big recursive call made on each previous blocks (you need the rewarded signer of many previous blocks to calculate the expected rewarded signer of a block).
These changes store the rewarded signer inside the block index so that this recursive call is not necessary.
The first startup after this patch is applied will take a long time because all the rewarded signers are calculated and the block indexes are rewritten.