Fix build warnings on windows - restrict some flags only to linux.