On Calibrating Semantic Segmentation Models: Analyses and An Algorithm