samples/net: Remove call to unref routine when net_send returns >= 0

According to last comments posted in ZEP-632, the unref routine must
be called only when net_send reports an error.

Jira: ZEP-632
Change-Id: I11553edf2c7d686c3e58617c2e05b6f18962955e
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
diff --git a/samples/net/dns_client/src/netz.c b/samples/net/dns_client/src/netz.c
index b57932b..b555fa8 100644
--- a/samples/net/dns_client/src/netz.c
+++ b/samples/net/dns_client/src/netz.c
@@ -151,7 +151,6 @@
 		rc = net_send(nbuf);
 
 		if (rc >= 0) {
-			ip_buf_unref(nbuf);
 			return 0;
 		}
 		switch (rc) {
@@ -168,7 +167,7 @@
 		}
 	} while (1);
 
-	return 0;
+	return -EIO;
 }
 
 static int tcp_rx(struct net_context *ctx, uint8_t *buf, size_t *read_bytes,
diff --git a/samples/net/mbedtls_sslclient/src/tcp.c b/samples/net/mbedtls_sslclient/src/tcp.c
index b5314ef..4aeaf41 100644
--- a/samples/net/mbedtls_sslclient/src/tcp.c
+++ b/samples/net/mbedtls_sslclient/src/tcp.c
@@ -68,7 +68,6 @@
 		rc = net_send(nbuf);
 		fiber_sleep(TCP_RETRY_TIMEOUT);
 		if (rc >= 0) {
-			ip_buf_unref(nbuf);
 			return size;
 		}
 		switch (rc) {
diff --git a/samples/net/nats_clients/publisher/src/netz.c b/samples/net/nats_clients/publisher/src/netz.c
index aa9df1e..ea15dcd 100644
--- a/samples/net/nats_clients/publisher/src/netz.c
+++ b/samples/net/nats_clients/publisher/src/netz.c
@@ -152,7 +152,6 @@
 		rc = net_send(nbuf);
 
 		if (rc >= 0) {
-			ip_buf_unref(nbuf);
 			return 0;
 		}
 		switch (rc) {
@@ -169,7 +168,7 @@
 		}
 	} while (1);
 
-	return 0;
+	return -EIO;
 }
 
 static int tcp_rx(struct net_context *ctx, uint8_t *buf, size_t *read_bytes,
diff --git a/samples/net/paho_mqtt_clients/publisher/src/netz.c b/samples/net/paho_mqtt_clients/publisher/src/netz.c
index 8d59276..6b916b3 100644
--- a/samples/net/paho_mqtt_clients/publisher/src/netz.c
+++ b/samples/net/paho_mqtt_clients/publisher/src/netz.c
@@ -152,7 +152,6 @@
 		rc = net_send(nbuf);
 
 		if (rc >= 0) {
-			ip_buf_unref(nbuf);
 			return 0;
 		}
 		switch (rc) {
@@ -169,7 +168,7 @@
 		}
 	} while (1);
 
-	return 0;
+	return -EIO;
 }
 
 static int tcp_rx(struct net_context *ctx, uint8_t *buf, size_t *read_bytes,