It happens to almost everyone... what happens is, just as your game closes, some more-less irrelevant error pops up and thus screen stays frozen as if you're still running the game and error box is behind it... in most of the cases it's like that, sometimes there is no pop-up error box... anyway, ultimate fix is just to press enter when the game freezes, that should close it, if not, you can use ALT+ENTER to go windowed before quitting and see if there is any pop-up error, and you can easily move your mouse off the screen and manually quit the game.
Of course, this is no petmanent solution, but could save your ass for some time. Reinstalling SA-MP/GTA SA and deleting GTA San Andreas user files could and should fix it if you are that desperate.