This is a silly idea that just came to mind, but I tried it and it worked!
The code that computes the ray-triangle intersection also produces the barycentric coordinates (u, v) of the intersection point. If either u or v or 1-u-v (the third coordinate) is small enough, then the intersection point should be close to the triangle edge. In that case, I set the triangle normal to the null vector (0,0,0,0). Nothing very special about this value, just a trick to get something different without messing with materials.