Port memory-full checking to GnuTLS 3.3

Instead of using gnutls_global_set_mem_functions, check every call
to a GnuTLS function that might return an indication of memory
exhaustion.  Suggested by Dmitry Antipov in:
http://lists.gnu.org/archive/html/emacs-devel/2014-12/msg02056.html
* src/gnutls.c (gnutls_global_set_mem_functions) [WINDOWSNT]: Remove.
(init_gnutls_functions): Do not load gnutls_global_set_mem_functions.
(fn_gnutls_global_set_mem_functions) [!WINDOWSNT]: Remove.
All uses removed.
(check_memory_full): New function.
(emacs_gnutls_handshake, emacs_gnutls_handle_error)
(gnutls_make_error, Fgnutls_boot): Use it.
(emacs_gnutls_global_init): Avoid gnutls_global_set_mem_functions.
Merge from origin/emacs-24

b54f572 Port memory-full checking to GnuTLS 3.3

Conflicts:
  src/ChangeLog
  src/gnutls.c
Wrap dll functions more simply

* decompress.c, gnutls.c, image.c, xml.c:
If WINDOWSNT, use '#define FOO fn_FOO' to wrap dll functions,
rather than the inverse when not WINDOWSNT.  This isolates the
fn_* business into the WINDOWSNT-specific section of the code,
which makes it easier to maintain the generic code.
* decompress.c (DEF_ZLIB_FN, LOAD_ZLIB_FN):
* gnutls.c (DEF_GNUTLS_FN, LOAD_GNUTLS_FN):
* image.c (DEF_IMGLIB_FN, LOAD_IMGLIB_FN):
* xml.c (DEF_XML2_FN, LOAD_XML2_FN):
Remove.  All uses replaced by DEF_DLL_FN.
* w32.h (DEF_DLL_FN, LOAD_DLL_FN): New macros.