Palantir reported Q3 earnings and revenue that topped Wall Street targets, boosted by U.S. government and commercial growth.