Close all file descriptors before restarting.

Refs #4905