Maintaining close friendships is vital for the mental health of middle-aged people and older adults, a new poll shows.