Raise ValueError if the password doesn't fit

Fixes #1235. OpenSSL only allows password up to 1024 bytes.
Instead of moving the errors related to password being given/not-given I've moved them all into the pem_password_cb method.