Fix closing of media

Based on fork of @matthewd to split CSS with media queries.

This fixes the issue where the assets cannot be compiled because the end
of a media tag would be inserted exactly at the next new file, issue: zweilove/css_splitter#25.

In other words, it fixes this issue:
Invalid CSS after "@charset "UTF-8"; ": expected selector or at-rule, was "}"