fixed memory leak due to circular dependency

ctx is not needed for filter and stats objects but prevents
perl from freeing memory.