Core/SmartScripts: Fixed heap corruption in SMART_ACTION_EQUIP

Closes #10739