Karunaratne keeps Sri Lanka in the runs after Bangladesh make 541