Safe-deposit boxes, popular among affluent, older customers, are being closed or scaled back as branches exit the business.