Fix CI_DB_query_builder::_merge_cache() triggering E_WARNINGs

Kudos to kakysha for noting the bug & providing initial fix in PR #2698
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index a36501e..95c3af3 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -2551,11 +2551,13 @@
 			$qb_variable	= 'qb_'.$val;
 			$qb_cache_var	= 'qb_cache_'.$val;
 
-			if (count($this->$qb_cache_var) === 0)
+			if (count($this->$qb_cache_var) > 0)
 			{
-				continue;
+				foreach ($this->$qb_cache_var as &$cache_var)
+				{
+					in_array($cache_var, $this->$qb_variable, TRUE) OR $this->$qb_variable[] = $cache_var;
+				}
 			}
-			$this->$qb_variable = array_merge($this->$qb_variable, array_diff($this->$qb_cache_var, $this->$qb_variable));
 		}
 
 		// If we are "protecting identifiers" we need to examine the "from"