Simulated annealing for tensor network states