G2LTraj: A Global-to-Local Generation Approach for Trajectory Prediction