brophdawg11/JsChannels — pull request #3 by dmitriiabramov (2014-10-28 22:17:58+00:00)
Title: add try/finally block around callback call

Add `try/finally` block around callback call.
if you have any error handling code around the write operation it will rescue the error but channel will remain silent because of `cbIndex >= 0` condition being evaluated to `true`

example code
```js
var A = 'before',
Channel = require('jschannels'),
Promise = require('es6-promise').Promise,
channel = new Channel();

channel.read(function(a) {
if (A === 'after') {
throw new Error('test');
}
console.log(a);
});

function write(a) {
(new Promise(function(resolve, reject) {
resolve(channel.write(A))
})).catch(function(err) {
// do stuff like log the error
});
}

for (var i = 0; i < 10; i++) {
write(A);
}

A = 'after';

for (var i = 0; i < 10; i++) {
write(A);
}

channel.write('test');
console.log('done');

```

will print

```
before
before
before
before
before
before
before
before
before
before
done
```

and no writes will go through any more even though the channel is not blocked