Existing code allows you to shutdown database while another thread is in the process of creating an index. IndexManager should wait for all the scheduled indexes to be created to finish before closing.
Created attachment 19642 [details] IndexManager.patch
I wonder if this problem is related to other index-corruption bug reports. Thanks for the patch, applied.