Fixed a bug in Windows implementation, added CryptReleaseContext call.