[mac-frame] remove unused variable in TxFrame::ProcessTransmitAesCcm() (#5185)

Eliminated an unused variable discovered when building using IAR.
diff --git a/src/core/mac/mac_frame.cpp b/src/core/mac/mac_frame.cpp
index 51d42de..1e23c53 100644
--- a/src/core/mac/mac_frame.cpp
+++ b/src/core/mac/mac_frame.cpp
@@ -1040,12 +1040,11 @@
     uint8_t        nonce[Crypto::AesCcm::kNonceSize];
     uint8_t        tagLength;
     Crypto::AesCcm aesCcm;
-    otError        error;
 
     VerifyOrExit(GetSecurityEnabled(), OT_NOOP);
 
-    SuccessOrExit(error = GetSecurityLevel(securityLevel));
-    SuccessOrExit(error = GetFrameCounter(frameCounter));
+    SuccessOrExit(GetSecurityLevel(securityLevel));
+    SuccessOrExit(GetFrameCounter(frameCounter));
 
     Crypto::AesCcm::GenerateNonce(aExtAddress, frameCounter, securityLevel, nonce);