Add a hasExternalStorageAsWritten helper. No functionality change.

It is possible that some of the current uses of
"getStorageClassAsWritten() == SC_Extern" should use this but I don't know
enough about SC_PrivateExtern to change and test them.