Merge pull request #1405 from alex/fix-pkcs12-decrypt-failures

Handle PKCS12 decrypt failures with OpenSSL 1.0.1j
Make FreeBSD happy with this constant
Merge pull request #1406 from reaperhulk/backport-101j-fixes

backport 1.0.1j fixes to 0.6.x