The spirit and letter of the landmark 40-year-old treaty that saw the UK return Hong Kong to China have been sorely tested