A new study suggests people who stay married for the long haul may gain some protection from dementia.