fix test error caused by GC timing problem

Fix previous error. It is GC timing problem. Methods to release AutoPointer are called some times at the same time.