Mortality and Function After Hip Fracture or Pneumonia in People With and Without Dementia.