unix: Fix mpconfig.h not being included before misc.h

This fixes count_lead_ones in misc.h not compiling due to unknown types
Merge pull request #729 from stinos/fix-include-order

unix: Fix mpconfig.h not being included before misc.h
py: Make unichar_charlen() accept/return machine_uint_t.
stmhal: Include mpconfig.h before all other includes.

It defines types used by all other headers.

Fixes #691.
windows: Sync mpconfigport.h with the unix' version

- rearrange/add definitions that were not there so it's easier to compare both
- use MICROPY_PY_SYS_PLATFORM in main.c since it's available anyway
- define EWOULDBLOCK, it is missing from ingw32