Elements may only be focused when they are visible .
Your attempt works, but comes too early, because when the element will be moved to it's control-position it looses the focus. What you need is to set the focus when the element has already been placed onto the map. As there isn't an event to find out when it happens(I wouldn't suggest to use DOMNodeInserted here), you need a delay before you set the focus.
Waiting for the tilesloaded
-event seems to be sufficient:
google.maps.event
.addListenerOnce(map,'tilesloaded',function(){jQuery('#location').focus()});