Implement the unregisterDevice method.