Only close a suggester if it's open

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