If A is willing to write EVL stating that you were continue working for them (and covering this period) it's fine. The safest way is to leave US and return with H1 visa stamp based on A's I-797 in the near future and certainly before you will file I-485. USCIS officer when checking your status during AOS adjudication, they may be suspicious because you filed H1 transfer, and if officer RFE your employment with A, your company must willing to state that you were working continuously. Because at that time of such RFE, you may no longer with A, A may not be willing to lie, that's why you make a plan to get H1 visa stamp as soon as it is convenient for you is important.