Appian’s CEO walked away from millions—twice—but the risk paid off: Now he’s now worth over $4 billion.