Palantir's second-quarter earnings beat expectations, and the AI software company lifted revenue guidance.