bthread.js: handle pool errors.
bthread.js: log errors.
Merge pull request #2 from chjj/pool-error

bthread.js: handle pool errors.