Learning Generalizable Policy for Obstacle-Aware Autonomous Drone Racing