USCIS never knows if you get your AP. You don't need AP to leave this country. Technically, you can go back home and fedex your AP to your home address. the question is that if you can get the AP at hand in time? I tried this way last year, finally wasted one flight ticket. If you have to go back without AP at hand, my suggestion is to bring back all doc for Visa with you and make an appointment at least three days before you return date. Now you can't get the visa at the same day you apply it. They mail your Visa and passport to you if at Shanghai.