Booming demand for Palantir’s AI solutions is restoring confidence in the company.