Core/Misc: Fix static analysis issues
Scripts/Misc: Fix static analysis issues

Replace CAST_AI() macro with ENSURE_AI() when dynamic_cast is not supposed to return NULL.
Core/Player: Fix an issue with Player::RemoveRewardedQuest not deleting the queststatus_rewarded form database

Needed for SPELL_EFFECT_CLEAR_QUEST
Merge pull request #12810 from Carbenium/questreward

Core/Player: Fix an issue with Player::RemoveRewardedQuest not deleting ...
Core/Trade: Fixed putting soulbound items to "will not be traded" slot
Scripts/Commands: Fix static analysis issues
Core/WorldSession: Fix socket not being closed on clean logout

Close the WorldSession socket if Player didn't even login or logged out successfully and then closed the client.
Merge branch 'master' of https://github.com/TrinityCore/TrinityCore