H1B visa stamping after resigning from current company

Hi,

I’m currently working with Company A. I have the petition from this company valid till “11/2019”. My H1B visa expired this year in September 2016. I have travel plan to go to India in November 2016. I’m traveling on 11/24/2016 and coming back to US on 12/26/2016.

I got offer from another Company B. They have filed for my Change Of Employer Petition in Premium. I should get the approval by 18th Nov 2016. The joining date in this new company is on 3rd Jan 2017.

My question is, Can i resign from my current company A, travel to India and get my visa stamped by using the new petition from Company B. And then travel back to US and join company B in January. I have the offer letter and Company Support Letter from Company B.

I’m worried about resigning from current company and getting the visa stamped in India without being employed. Please advice what should i do in this case.