main_encrypt_pipe(): cleanup: mdctx: destroy only when not NULL (fixes crash on windows)