libshell: Adjusted autocompletion to insert common prefix first

If all the possible completions have the same prefix, it will be
appended as the first completion.
Fixed|Server|libcommon: Player's weapon was undefined after map change

Now the player's ready weapon is always updated after the map changes
and the players are respawned. The bug occurred at least in Heretic.