I found a workaround. You place a style.css file in your theme’s main directory, and you keep your code in your header as mentioned above. This way the backend thinks you are using style.css, and it doesn’t revert to the classic theme. It’s a bit silly, because you need one additional file to make it work, so I would rather have a more elegant solution.
Can anyone help me?