Wave propagation in a weak gravitational field and the validity of the thin lens approximation