Some refactoring for code robustness.
Some refactoring for code robustness.

Rather than doing important things after the switch statement, wrap
the switch in another function. That way it's safe to return from
inside the switch.

bmhatfield/beanstalkd,davies/beanstalkd,naderman/beanstalkd,LomoX-Offical/beanstalkd-win,PhillipMwaniki/beanstalkd,cgvarela/beanstalkd,wyzssw/beanstalkd,amyvmiwei/beanstalkd,r3jack/beanstalkd,qbdsoft/beanstalkd,potatosalad/beanstalkd,handautsav/beanstalkd,pinguo-xudianyang/beanstalkd,pinguo-xudianyang/beanstalkd,handautsav/beanstalkd,CompendiumSoftware/beanstalkd,diditaxi/beanstalkd,wfxiang08/beanstalkd,naderman/beanstalkd,mobliyishengyuan/beanstalkd,kr/beanstalkd,amyvmiwei/beanstalkd,mickeyouyou/beanstalkd,potatosalad/beanstalkd,orangeholic/beanstalkd,aidaima/beanstalkd,ifduyue/beanstalkd,r3jack/beanstalkd,naderman/beanstalkd,orangeholic/beanstalkd,tdg5/beanstalkd,CompendiumSoftware/beanstalkd,LomoX-Offical/beanstalkd-win,JensRantil/beanstalkd,yetone/beanstalkd,diditaxi/beanstalkd,davies/beanstalkd,kr/beanstalkd,justintung/beanstalkd,cgvarela/beanstalkd,aidaima/beanstalkd,PhillipMwaniki/beanstalkd,JensRantil/beanstalkd,mickeyouyou/beanstalkd,lzpfmh/beanstalkd,bmhatfield/beanstalkd,lzpfmh/beanstalkd,Qihoo360/beanstalkd-win,justintung/beanstalkd,wyzssw/beanstalkd,wfxiang08/beanstalkd,tdg5/beanstalkd,Qihoo360/beanstalkd-win,qbdsoft/beanstalkd,yetone/beanstalkd,mobliyishengyuan/beanstalkd,ifduyue/beanstalkd