tap: fix memory leak on failure in net_init_tap()