Refactor PEM_read_bio_{PrivateKey,Parameters,DHparams}