To the best of my knowledge the only way to keep the quarian fleet from destroying the Geth is by allowing Legion to upload the code. I maybe wrong though. I don't actually like the ending BTW I have just taken it upon myself to try and find logic in the choices Bioware made it helps me cope I guess 

. 
If you extrapolate my reaper code idea further it would mean that relays were simply shut off. Destroy was not physical destruction but a shutdown command. It suddenly isn't space magic anymore, but a radio signal. This works for control too, but synthesis throws that all out th window.