Linear maps preserving idempotency of products or triple Jordan products of operators