Ticket 328 - make sure all internal search filters are properly escaped
Fixing double-free issues introduced with commit 3cf9a521fa43183c657a5dca507dec3a4379e383.
1) If ctx.buf is realloc'ed in filter_stuff_func, slapi_filter_sprintf
returns already freed buf. And the buf is freed by caller, again.
2) If filter escape occurs in get_substring_filter, freed val is
returned to caller via "struct slapi_filter *f" and it is freed