Fix DocumentHasPassword check
A document can be encrypted without requiring a password to open/sign it.
Currently we assume we need a password to sign it for such documents, but that's not correct.
Instead of checking whether the document is encrypted remember whether we needed a password for opening.
Test plan:
Sign the document from the bugreport: No password is needed when signing
Sign a document that needs password to open: Still need the password for signing
Edited by Nicolas Fella