More fixes for the msvcrt module.

IOErrors are now raised with proper information and the calling convention for the P/Invokes has been set to cdecl. Also remove SetLastError for functions that don't use it.