Fix import error on possible stat-leak fix
Add test case for memory leak