Memoize promises, auto-invalidating on rejected ones.