Fulfil promise once connections are closed

Fixes #86