Poor sleep in middle age could affect the brain in a surprising way, study finds