netdev: Correctly maintain netdev refcounts even if errors occur.