mempool: introduce a function to free a pool