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