I tested running nvidia in its own X server directly driving the HDMI output connected to the nvidia card, in order to rule out any potential problems there might be in using virtualgl to transport the graphics output back to the intel GPU (details at
https://github.com/Bumblebee-Project...bee/issues/237).
However, with this configuration the nvidia driver again crashed with a Xid 13 error and shortly afterwards the laptop hung. So it's looking very likely that it's an nvidia bug causing this and not anything to do with bumblebee.
I also tried running the test application on an nvidia 8600M card, and it didn't crash during my test (this is not conclusive, but since the 540M crashes so readily and quickly it seems a reasonable assumption that the 8600M card doesn't have the same issue with the 304.43 driver). So in case it was one of the new features in the nvidia 540 card, I modified wine to return OpenGL and GLX info matching the 8600M card on the machine with the 540M card. But even with this configuration, the nvidia driver still crashed as usual on the 540M card.