ECSignature: enforce valid hashType in toScriptSignature