You don't have to be racist to make a racist joke... and most racist jokes are funny.
My suggestion is take it as a joke (since the person doesn't even know your race), and if you can't, grow a thicker skin.
I don't think disconnecting is the appropriate response in this situation. It just makes sense that there should be a penalty for disconnecting from a game, which will generally lose your team the game and make the game considerably less enjoyable for everyone else. Even if you have what seems like a good reason to disconnect, you shouldn't. The ignore and mute functions are implemented in this game so that you don't have to endure these types of comments. They're immature and a poor reflection on the people who make them, and I expect it would be very tiresome to repeatedly come across them, but it's not like you're being forced to endure them while those functions exist. So I'm sympathetic to your situation, but I think you need to stop disconnecting from the games and instead ignore them. Try opening the scoreboard and pressing the speech bubble button to add the offenders to ignore, then report them after the game (take a screenshot if necessary). If they accrue enough reports then hopefully they'll be removed from the community for awhile.