Fix access to lifetime dict in update_ipsecpolicy method

Also add corresponding unit test.

Change-Id: Ie1141b5034415ccf3039a71dfedc47cfb2ca7a88
Closes-Bug: #1237912
Merge "Fix access to lifetime dict in update_ipsecpolicy method"