Add some optimizations to tun(4) to improve speed