Updated function in flashtools to close opened file.