polarssl threadlock cleanup