Smoothed Analysis of Belief Propagation for Minimum-Cost Flow and Matching