it doesn't matter if the expiration date is close to your returning date. once you get here and file it, you have 240 days to work legally without travelling.
worst case senario:
if your h1b extension is approved days ealier than your entry date to US, your latest I-94 would be effective, so you have to file another h1b extension right away