fix crash due to exception thrown: [TypeError: Object object has no method 'close'] on Kubuntu 12/64bit VM, node 0.10.0