Catch exception during connection to the server (happens due to the bug in pecl extension)

Bug in pecl gearman extension:

https://bugs.php.net/bug.php?id=63041