o.stoll,
As usual of course, you are right - being a lawyer to trade I can vouch for that. Of course, morally I wouldn't agree with somebody however agreeing to those terms and conditions at the outset (which in ALL of these cases is the case) accept thousands of pounds in funding for fees and TENS of thousands of pounds personally by way of stipend, in many cases being given the benefit of being able to teach classes and then walk away from the agreement once their own personal benefit has ended without giving anything back! Ok, so 3 years I would say IS over the top, but a year or possibly two I wouldn't say is much to expect.
So in contract terms - unenforceable, but I'd think twice about burning your bridges at a University (which you WOULD be doing) if you're seriously considering staying in academia. Especially so since many staff members will have links to other Universities also.