Core/SmartScripts: Fixed heap corruption in SMART_ACTION_EQUIP

Closes #10739
Merge branch 'master' of https://github.com/TrinityCore/TrinityCore into teste2