Make sure handles aren't inherited by the child process.

Refs #6107
Properly shut down TLS streams.

Refs #6107