49ers beat Chargers in third exhibition game