Backport mingw warning fix from 0.3.1.
In 19615bce64cd381a925bc3910120ac39ca918e7c I committed a fix for "unused variable" warnings in test_switch_id.
This bug now prevents the mingwcross builders on jenkins from running; I propose that we backport the fix to 0.2.4 0.2.8 and forward so we can have our CI work again.