Fix that REPL crashes in shell mode on $a<tap> and make it auto complete

This fixes that the REPL crashes if:
```julia
shell>$a<tab>
```
Line 267 is necessary to make the REPL not crash when the input does not match the if conditions.
line 260 enables the auto completion for `shell>$a` instead of it only works of `shell>$(a` I can't find any negative effects of removing the additional conditions. Can @nolta  or @Keno approve the removal of the conditions?

I did not know that the repl could insert variables in shell mode by `$` before I looked into this problem is there a place for documenting this?