On ioctl recording, also record the device name on close()

In ioctl_record_close() we completely rewrite the file, and thus have to write
the @DEV header, too.