ActionPiece: Contextually Tokenizing Action Sequences for Generative Recommendation