CONN-1394, CONN-972, CONN-1420 

Fixes for security scan include unclosed stream, password in code, and insecure random