avoid possible double free error on tests by setting autorelease off

`free` method is used explicitly to immediately call dispose method for test because sometimes tests finished before GC. This will fix double free in the test cases.