cec_test: Register device only if needed

* Only register the device if needed.