There is every possibility that employer-A might widthdraw its H1B petition. If your employer-B will file premium processing, then employer-B might be able to transfer your H1B. However, USCIS will get your H1B transfer withdrawn petition from employer-A which is recorded in their files. This might slightly be tricky issue.
However, if the USCIS recieves the file after your petition is filed, then you will be on the safer side.