Also define UNICODE, not just _UNICODE on Win32
Make type conversion explicit

Fixes a warning with GCC 4.8 and some Boost versions.