fix issue 157

Since when doing copyAndClear, it synchronized the Batch instance. 
To synchronize the method, to avoid the ConcurrentModifyException.