WiFi-HAL: Consider min threshold only if complete record available

Buffers will be read if ring buffer reaches minimum configured
threshold. It is possible to reach minimum threshold after writing
header to the buffer and before writing actual payload. Incomplete
buffer will be read out in this case. This commit ensures to read
the data from buffer only if complete record is available.

Change-Id: I0c558e4cf73ea31892c8c086f2310405ebc49c74
CRs-Fixed: 904848
Bug: 23934884
diff --git a/qcwcn/wifi_hal/ring_buffer.cpp b/qcwcn/wifi_hal/ring_buffer.cpp
index 790b007..f346b2d 100644
--- a/qcwcn/wifi_hal/ring_buffer.cpp
+++ b/qcwcn/wifi_hal/ring_buffer.cpp
@@ -325,6 +325,7 @@
     /* check if valid bytes is going more than threshold */
     if ((rbc->threshold_reached == RB_FALSE) &&
         (rbc->cur_valid_bytes >= rbc->num_min_bytes) &&
+        ((length == record_length) || !record_length) &&
         rbc->threshold_cb) {
         /* Release the lock before calling threshold_cb as it might call rb_read
          * in this same context in order to avoid dead lock