Add a workaround for #ifdefs

Ignore all lines that start with # when figuring out the position
to insert the new pragma. Doesn't solve all problems with #ifdefs,
though, just ensures all language pragmas are always (fs reasonable
vo always) sorted.

I'm not sure it makes sense to try to do something clever to place the
pragmas inside or outside #ifdef'ed blocks correctly or if it's even
possible, so I leave it at that.