Sputtered TiN thin films for improved corrosion resistance