hciattach: Bring up device before sending commands over socket

The Texas specific initialization code sends HCI commands over the
bluetooth socket, but does not bring up the device. This gives these
errors when running "hciattach /dev/ttyUSB0 texas":

Found a Texas Instruments' chip!
Firmware file : /lib/firmware/TIInit_XX.Y.ZZ.bts
Loaded BTS script version 1
Cannot send hci command to socket: Network is down
Can't initialize device: Network is down
diff --git a/tools/hciattach_ti.c b/tools/hciattach_ti.c
index 7627bc1..e107a65 100644
--- a/tools/hciattach_ti.c
+++ b/tools/hciattach_ti.c
@@ -514,6 +514,13 @@
 		return -1;
 	}
 
+	if (ioctl(dd, HCIDEVUP, dev_id) < 0 && errno != EALREADY) {
+		fprintf(stderr, "Can't init device hci%d: %s (%d)", dev_id,
+							strerror(errno), errno);
+		hci_close_dev(dd);
+		return -1;
+	}
+
 	ret = brf_do_script(dd, ti, NULL);
 
 	hci_close_dev(dd);