Fixed a bug where encryption would fail if app was garbage collected

This would occur if an encrypted message was received and the
app was garbage collected, resulting in the encryption engine
attempting to access deallocated memory resulting in a null pointer.