Catch exception during connection to the server (bug of pecl gearman extension)

https://bugs.php.net/bug.php?id=63041