improve thread pool logic
FS-5827: cleanup postgres version detection to support devel versions better