Only destroy dinput if non-NULL.