worker: shutdown gracefully even if no gearman connection

- previously got error: Cannot read property 'bufferSize' of undefined
- this occurred when failed to connect to the gearman machine