nat: Move BSC msg sending to a new method.

Move all writes into one place so we can switch to the
write queue more easily in the future.
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c
index 0972208..4694788 100644
--- a/openbsc/src/nat/bsc_nat.c
+++ b/openbsc/src/nat/bsc_nat.c
@@ -269,6 +269,11 @@
 	/* do we need to send a GSM 08.08 message here? */
 }
 
+static int bsc_write(struct bsc_connection *bsc, u_int8_t *data, unsigned int length)
+{
+	return write(bsc->write_queue.bfd.fd, data, length);
+}
+
 static int forward_sccp_to_bts(struct msgb *msg)
 {
 	struct bsc_connection *bsc = NULL;
@@ -314,7 +319,7 @@
 		return -1;
 	}
 
-	return write(bsc->write_queue.bfd.fd, msg->data, msg->len);
+	return bsc_write(bsc, msg->data, msg->len);
 
 send_to_all:
 	/*
@@ -348,7 +353,7 @@
 				if (!bsc->authenticated || _lac != bsc->lac)
 					continue;
 
-				rc = write(bsc->write_queue.bfd.fd, msg->data, msg->len);
+				rc = bsc_write(bsc, msg->data, msg->len);
 				if (rc < msg->len)
 					LOGP(DNAT, LOGL_ERROR,
 					     "Failed to write message to BTS: %d\n", rc);
@@ -362,7 +367,7 @@
 		if (!bsc->authenticated)
 			continue;
 
-		rc = write(bsc->write_queue.bfd.fd, msg->data, msg->len);
+		rc = bsc_write(bsc, msg->data, msg->len);
 
 		/* try the next one */
 		if (rc < msg->len)