Collect style tags the same way as we collect script tags.

That is, collect everything up to the end tag in one step. This fixes issue #3328.