Fix a memory leak in pecan.util.memodict

Change-Id: Id50ca4d689fa09b15b0928e6e20d336f93a1e85c
Fixes-bug: 1266908