Sharing a cry over a sad film can strengthen connections between people – even if they are strangers, research has suggested.