merged in changes from Travers Carter as attached to ticket at http://mysqludf.lighthouseapp.com/projects/71824/tickets/1-possible-bug#ticket-1-1

The merge and conflict resolution was done on a private repo. The conflicts occurred due to the poor release of 1.1 and the fact that this patch was for 1.0.1.

Also, there were some autoconf things that needed to be done to get these improvements to work on OSX.

*	modified:   INSTALL
*	modified:   Makefile.am
*	modified:   Makefile.in
*	modified:   config.h.in
*	new file:   config/ax_pthread.m4
*	modified:   configure
*	modified:   configure.ac
*	modified:   doc/Makefile.in
*	modified:   from_php.c
*	modified:   ghmysql.c
*	modified:   ghmysql.h
*	modified:   lib_mysqludf_preg_capture.c
*	modified:   lib_mysqludf_preg_check.c
*	modified:   lib_mysqludf_preg_info.c
*	modified:   lib_mysqludf_preg_position.c
*	modified:   lib_mysqludf_preg_replace.c
*	modified:   lib_mysqludf_preg_rlike.c
*	modified:   preg.c
*	modified:   preg.h
*	modified:   test/Makefile.in
*
* Untracked files:
*   (use "git add <file>..." to include in what will be committed)