Get an old pool in a synchronized block

It has race condition if it is placed outside of the block.
Merge pull request #227 from tkawachi/race

Get an old pool in a synchronized block