Reset promise chain within callbacks to prevent deadlocks

Fixes #14.