Latham hits century as NZ ends Day 3 at 196-4 vs. Sri Lanka