lib/noise: fix gradient_vector to return a unit vector