Add a locking mechanism to IsInitialBlockDownload to ensure it never goes from false to true.