add connection termination listener

fixes #80 and [bookshelf #47](https://github.com/tgriesser/bookshelf/issues/47)