Yep, you can legally still file for H1B transfer to a new company....
Your scenario was clearly covered by William Yates in this memo...check out the last pages....
http://www.uscis.gov/files/pressrelease/AC21intrm051205.pdf
>>>>>
Question 1. Can an H-1B temporary worker “port” under §105 of AC21 (INA § 214(n)) from one employer to another even after the alien’s I-94 or last approved petition has expired as long as he or she is still in a “period of stay authorized by the Attorney General”?
Answer: Yes. Under certain circumstances, an H-1B alien may still be able to port to another H-1B employer even after the alien’s I-94 or last approved petition has expired. In order to port, however, such alien must meet all the requirements of INA § 214(n), including the requirement that the new petition be filed while the alien is in a “period of stay authorized by the Attorney General.” USCIS has previously determined and issued guidance explaining what constitutes a “period of stay authorized by the Attorney General.” One example would be:
Alien is in H-1B status. Employer A timely files a non-frivolous extension of the alien’s H-1B status. Alien’s original petition, approved for Employer A, expires during the pendency of the extension. Alien is then in a “period of stay as authorized by the Attorney General” while Employer A’s extension is pending. Employer B then files new petition and alien wants to port to Employer B. Under INA § 214(n), the alien should be permitted to port because he or she is in a “period of stay as authorized by the Attorney General.”
In other words, porting under INA §214 does not require that the alien currently be in H-1B status as long as he or she is in a “period of stay authorized by the Attorney General.”
Question 2. Can there be successive H-1B portability petitions filed for an alien while the previous H-1B petitions remain pending (i.e. creating a “bridge” of H-1B petitions)?
Answer: Yes. However, to be approved every H-1B portability petition must separately meet the requirements for H-1B classification and for an extension of stay.
Question 3. If successive H-1B portability petitions can be filed, what happens if an alien’s nonimmigrant status expires while the H-1B portability petitions are pending and a petition in the “bridge” is denied?
Answer: As stated above, to be approved every H-1B portability petition must separately meet the requirements for H-1B classification and for an extension of stay. In the event the alien’s nonimmigrant status has expired while the petitions are pending, the denial of any filing in the string of extension of stay and/or change of status filings undercuts the “bridge” that “carried” any petition filed after the expiration of any approved status which will result in the denial of the successive requests to extend or change status.