Trap OpenSSL::Cipher::CipherError for JRuby

We need to check the error message, since `CipherError` can arise for
different reasons.
The error message checking is unfortunately rather iffy, since older
versions of JRuby had a typo in the error message.