Heterocyclic corrosion inhibitors for neutral environments