BERN, March 19 (Reuters) – UBS (UBSG.S) agreed to buy rival Swiss bank Credit Suisse (CSGN.S) for 3 billion Swiss francs ($3.23 billion) in stock and agreed to assume up to 5 billion francs ($5.4 billion) in losses, in a shotgun merger engineered by Swiss authorities to avoid more market-shaking …