If the device is closed without previously running hw_openedev the driver crashes (happens in cleanup). This patch checks if the device has been opened.