Update PolarSSL to current stable version

Some of these commits can obviously be squashed but I'll leave them for now for easier review.

Compiles on Linux and Windows, nothing else tested yet.