Assessment of common infections and incident dementia using UK primary and secondary care data: a historical cohort study