vcl: fix api detach if attach failed