The 49ers built a big first-half lead over the Commanders, but the offense disappeared in the second half and a much-flagged defense barely fended off Washington to seal the victory.