Refs #7363. Fixing crash issue on Windows when closing the VSI.

A big thanks to Martyn and Owen for tracking this one down!