ipsec esp: avoid dereferencing freed secasindex
(cherry picked from commit 1a56620b7958cac2b9048589cb730c46958ab539)