Use gerr object to analyze thread_pool_new error

Check gerr value and return its err_code instead of using the return value.

Signed-off-by: Yaniv Bronhaim <ybronhei@redhat.com>