I don't know a way to fix it, but I do know of a possible solution. Back when I was playing Vice City (I was on XP at the time), when it froze, sometimes I had to wait 20 seconds for it to exit (sometimes it didn't even exit) and although pressing CTRL+ALT+DEL opened task manager, it was pretty useless because the frozen game stayed on the top, so I couldn't see what I was doing. My solution was to make a batch file which could be opened by pressing a few keys (I set it to CTRL+ALT+Q), that would terminate the Vice City process. The same method can be applied to San Andreas.
My question to you is, can other processes still run in the background or does your computer get absolutely frozen?
BTW, the batch file code is really simple: taskkill /f /fi "imagename eq gta_sa.exe"