Fix cp28386.

Add additional checks of the passed in mode.

I'd like some additional eyes on this one since it's a pretty fundamental part of IronPython (opening files).
Just wonder, how can I trigger a mode argument which contains encoding?