(#7659) lexer: better detection for braces opening hashes

There is a number of contexts in which hashes can be put inside a manifest
that were not regarded during the original bugfix.

This improvement is courtesy of Henrik Lindberg, who pointed out the additional
indicators and provided a code structure that implies fewer equality tests
against current and previous token.

Syntax examples that are now recognized:
  foo {a=>1}
  foo({a=>1})
  foo(1, {a=>1})
  $x ? { {a=>1} => ...}
  case $x { {a=>1}: { ... }}
(#7659) add more tests for possible hash use syntaxes