Fixed compatibility issue with PolarSSL 1.3.x.

Separated IV initialization from reset. As per PolarSSL migration guide to version 1.3: https://polarssl.org/kb/how-to/migrate-from-polarssl-1.2-to-polarssl-1.3