Fix crash deleting category with new affix template (LT-13932)

This is a Windows-only bug, but the fix is safe for Mono/Linux.

Change-Id: If78c9f01a6639eeec3910937d5ca1a0134cad6ea