lib: fixed to drop state before deleting netdev