Studies have linked certain sleep habits to an increased risk of dementia.