Practically, I seriously, seriously doubt that any residency program would sue/go after a resident for breach of contract for entering the match. As long as you don't do something ridiculous like tell them you are leaving a week before you leave (or leave after signing your contract for next year) I seriously doubt there will be legal repercussions for you. ...
I would worry more about personal/career repercussions...probably won't matter if they hate you if you are changing specialties, but remember in the future you'll need stuff from your current hospital's GME office, and probably your current department's PD or his/her secretary. I had a friend switch specialties, after not being on good terms w/his old hospital/specialty, and he had problems getting the required documentation from them later...they'd always drag their feet about providing confirmation of his intern year for state licensing boards, etc. I'd worry more about that than some hypothetical lawsuit that isn't going to happen.