Deparse predeclared prototyped subs

A predeclared sub without a prototype works fine:

$ ./perl -Ilib -MO=Deparse -e 'sub f; sub f{}; foo()'
sub f {

}
foo();
-e syntax OK

A prototyped sub with no predeclaration is fine:

$ ./perl -Ilib -MO=Deparse -e ' sub f($){}; foo()'
sub f ($) {

}
foo();
-e syntax OK

A prototyped stub is fine:

$ ./perl -Ilib -MO=Deparse -e 'sub f($);  foo()'
sub f ($);
foo();
-e syntax OK

Only a predeclared prototyped sub seems to have trouble appear-
ing properly:

$ ./perl -Ilib -MO=Deparse -e 'sub f($); sub f($){}; foo()'
sub f;
foo();
-e syntax OK

The code that searches the stashes (stash_subs) was assuming that any-
thing of type B::PV was a prototype.  In this case, the stash entry
started as a string and then got ‘downgraded’ to a reference, so
internally it is of type PV (which can hold a ref), which B represents
as B::PV, so the assumption that a PV is a prototyped stub is wrong.
Deparse PVMG stubs

Creating a weak reference to a stash entry will cause it to be of type
PVMG, if it was not a GV already.  B::Deparse was trying to determine,
based on the internal SV type, whether it had a sub stub.  It should
be checking flags instead, otherwise valid stubs get omitted.