[perl #123313] sub { f(); BEGIN{} } was void cx

In v5.21.6-11-g34b5495 I accidentally put the last statement in a
block in void context when followed by a sub declaration.  scalarseq,
and not just scalar, needs to know about the extra ex-cop kid.
make more use of NOT_REACHED

In particular, remove all instances of 'assert(0);'.
define and use STATIC_ASSERT_STMT for compile-time invariants
scalar($#foo) needs to propagate lvalue context

$ ./perl -Ilib -le 'for($#foo) { $_ = 3 } print $#foo'
3
$ ./perl -Ilib -le 'for(scalar $#foo) { $_ = 3 } print $#foo'
-1

If I replace $#foo with $foo, I get the same results from both
one-liners.

In commit d408447cb6 (pre-5.16) I tried propagating lvalue context,
but I did not take into account things like \scalar @array, which
ended up being equivalent to \@array, instead of a returning a refer-
ence to a scalar holding the length of the array.  So I reverted it in
41b1a11c.  See bug #106288.

The $#foo example above, which I recently ran into, shows that we
really do need to propagate lvalue context.  (Come to think of it, it
is just a variant of the test I added in d408447cb6.)  But we need to
be careful what kind we propagate.  If scalar itself is in lvalue con-
text, then, regardless of the type, we need to apply ‘entersub’ lvalue
context to its argument.  Also, to preserve existing behaviour as much
as possible, this time scalar(...)= still dies.