Berlin residents voted to transfer to public ownership some 240,000 apartments controlled by the city’s biggest corporate landlords.