In the UART, enable TXBUFFER_EMPTY interrupt source
create a nice buffer that will act as middle guy (i pushed 1400+ packages so size matters)
when you get data from the WiFi, put it in the buffer and return from the function so the ack can be sent
then your UART interrupt routine will pick up that there are bytes waiting in the buffer and will send those over the line.
When you get data in the UART ISR, send that over to the wifi.
You need to understand that anything you do holding the data receive callback will slow you down lots
without anything, but filling a buffer, I was able to upload over HTTP (running on the ESP) a 7MB file for 6.3 seconds.
What ESP model are you using?
How are you getting the data from avrdude to the ESP? Custom avrdude or another ESP?
I will advise you to get an ESP with GPIOs 12,13 and 14 exposed, take a look at my arduino-like library and go ISP
I have example code that I can give you that turns those avrdude commands into ISP SPI commands and can program just about any AVR chip.
ISP can run at 8MHz for most chips which will increase the programming and response time by lots!
I'm already thinking about using that upload code I just created to test your issues and make a web ISP programmer open the page, select options, pick the hex and upload you go