[IOT-3106] Memory leak when converting PEM to DER