net/tap: fix cleanup on allocation failure