Failure mechanisms of TiN thin film diffusion barriers