Structure of trimers of group-2B metal dihalides from relativistic density-functional calculations