js: name changed while typing
there used to be a slight bug. Suppose the user types a text in the
input box, and never changes the focus.
Then, she press "Stop". the click and the focus lost happen in nearly
the same moment, which leads to a race in which the name is set only if
the /api/update arrives before the /api/generate.
Sending the message before losing the focus mitigates the issue