Attempt to fix crash when deleting StatBlock

Fixes #1176 

I can't reproduce the original bug, but I think this is the correct solution. If anyone can reproduce the bug, please try this.