Pathways of atomistic processes on TiN(001) and (111) surfaces during film growth: An ab initio study