Windows Azure Storage uses an MD5 hash to verify that it has correctly written data to disk. When mongod.exe modifies the buffer while it is being flushed to disk, this makes the MD5 comparison fail, and Azure Storage retries the operation. If it fails 4 times, Windows fails the call to FlushViewOfFile with error code 1 (ERROR_INVALID_FUNCTION), causing mongod.exe to issue Fatal Assertion 16387, with immediate exit.
There is no requirement internally for WRITETODATAFILES to be allowed to run while FlushViewOfFile is running, and it could be argued that this is not the right thing to do. Preliminary testing shows that adding a mutex between these two threads prevents the Windows Azure Storage retries. This will probably improve worst-case performance (by avoiding the retries) and will prevent Fatal Assertions caused by excessive retries.