Don't call ast.fix_missing_locations unless the AST could have been modified

Should close gh-2879, and give a tiny improvement in performance.