Only cleanup CMI-related state on detach if the system supports CMI.

PR:		kern/163268
MFC after:	1 week