tests.unattended_install: Close all opened files

There are some files opened without closing, this
patch tries to close them all.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>