Darn...
Yet, this is indeed the invisprim code change that introduced this bug... There are two bugs actually:
The first is due to the (inappropriate) simplification I did by calling LLDrawPoolInvisible::render() from LLDrawPoolInvisible::renderDeferred(), because I did not notice the gGL.setColorMask(true,
true) in the latter (instead of false in the former). The second bug is that gGL.setColorMask(true, true) must still be called from LLDrawPoolInvisible::renderDeferred() whenever insiprims rendering is disabled...
I'm going to publish a fixed version later today since it also affects other stuff than just legacy avatars in a sky background...