Court clears student who threw shoe at Chinese leader British judge tells 27-year-old German student to watch his behaviour in the future