A burglar who was caught in an elderly dementia patient’s bedroom at a Leeds care home has been jailed.