Set the value of the suggester target element before closing

The old behaviour caused problems with Wikibase client's
linkItem: The selected page disappeared once the user clicked
on anything (including the submit button).