Check for specific exception raised in FlagCollection instead of string content of exception

This closes one of the windows 64-bit test failures on appveyor seen in #2755
Just checked #2755 - I'd still check that the message starts with 'flags array shape' (it's always best to make sure the *right* exception is being raised)