MDEV-5039: incorrect Item_func_regex::update_used_tables()

Other fix of maybe_null problem and revert of revno: 3608 "MDEV-3873 & MDEV-3876 & MDEV-3912 : Wrong result (extra rows) with ALL subquery from a MERGE view."
merge 5.3 -> 5.5
MDEV-5076 : Build on FreeBSD - when looking for execinfo library, and execinfo.h header,
allow user-defined EXECINFO_ROOT prefix, in case library and header are not placed under /usr/local . This change was requested by FreeBSD maintainer.
Fixed bug mdev-5028.
Apparently in a general case a short-cut for the distinct optimization
is invalid if join buffers are used to join tables after the tables whose
values are to selected.
MDEV-3856 Import of a large polygon fails/hangs.
        The Gis_point::init_from_wkt called the String::realloc(),
        and this call is quite slow in the DEBUG mode. Which makes
        loading the huge polygon hang forever.
        Fixed by using the String::realloc(size, inc_size) version instead
        as it's done for other spatial features.
MDEV-4788 check mysql-5.5 changes in spatial.cc.
        Additional patch for the 5.5.
MDEV-5131 create_embedded_thd is not thread safe, libmysqld.
        LOCK_thread_count locked when we do threads.append().
Merge 5.3-5.5
MDEV-5131 create_embedded_thd is not thread safe, libmysqld.
        The emb_free_embedded_thd() has the thread-unsafe code
        so should be 'mutexed' also.
Merge 5.3->5.5
Merge
MDEV-4981: Account for queries handled by query-cache in USER_STATISTICS (and in HOST_STATISTICS)

Added collection statistics for queries resolved via query cache.
Fixed bug mdev-5078.
For aggregated fields from views/derived tables the possible adjustment
of thd->lex->in_sum_func->max_arg_level in the function Item_field::fix_fields
must be done before we leave the function.
Fixed bug mdev-5105.
The bug caused a memory overwrite in the function update_ref_and_keys()
It happened due to a wrong value of SELECT_LEX::cond_count. This value
historically was calculated by the fix_fields method. Now the logic of
calling this method became too complicated and, as a result, this value
is calculated not always correctly.
The patch changes the way how and when  the values of SELECT_LEX::cond_count
and of SELECT_LEX::between_count are calculated. The new code does it just at
the beginning of update_ref_and_keys().
Fixed a problem of the patch for mdev-5105 that caused valgrind complains.
Fixed bug mdev-5132.
Objects of the classes Item_func_isnull and Item_func_isnotnull
must have the flag sargable set to TRUE.
Set the value of the flag sargable only in constructors of the 
classes inherited from Item_int_func.
Fixed bug mdev-5135.
The patch for bug mdev-5105 incorrectly counted conditions in nested joins.
MDEV-5107:Left Join Yields All Nulls Instead of Appropriate Matches
MDEV-5034:Wrong result on LEFT JOIN with a SELECT SQ or a merge view, UNION in IN subquery

Make reset null_row same as it was set in evaluate_null_complemented_join_record().

The problem was that view firlds detect null_row by not-yet-reset table.
MDEV-4981: Account for queries handled by query-cache in USER_STATISTICS (and in HOST_STATISTICS)

fix for SP & PS
MDEV-4890 Valgrind warnings on shutdown on a build with openSSL