Two pubs in Hampshire have launched a new initiative to tackle loneliness.