Using Promise.prototype.finally() in TypeScript