Jointly optimal regulation of bank capital and maturity structure