Fix severe conn pool leak when using security check