MBS-6721: Fix crash in /ws/js/work autocompletion

If there are no matching results, we need to be careful not to
accidently mutate the result list. The previous code expected that
the result list was not empty ($results->[0]->{current_language}),
and by doing so autovivification stepped in and created an empty
hash. This later crashes _work, which expects the hash to be non-empty.

This commit prevents this autovivification from happening by first
checking that the result list is non-empty.