Research has found that having good friendships could be as important as exercise and diet for living longer.