convert perror() and fprintf() calls to pool_error()