Prevent double-writing the `@media` and other at-rules. Fixes #1534