Initialize event pointer with NULL to avoid SEGV.

The event pointer in exec_command in clFinish.c was not
initialized.  In some cases, some uninitialized value will
be dereferenced and result in SEGV.
Added Logan Chien to the CREDITS
Remove unused variables.
Silence the unused variable warning by void cast.
Comment unused labels.
Avoid signed unsigned comparison.

Change the type of ReplThreshold from size_t to int.
Add parenthesis to bitwise and operator.
Move workgroup_variables to same preprocessing scope.
Discard unused return value: num_properties.
Add missing -lpthread to libpocl_la_LIBADD.
Check the return value of clEnqueueReadBuffer.
Cast the userdata properly to avoid format string warning.
Fix uninitialized variables num_channels, elem_size.
Fix the pthread link error when -Werror is specified.

The ACX_PTHREAD() macro can't detect pthread properly when
-Werror is specified.  This commit fixes this issue by
removing the -Werror from $CFLAGS and $CPPFLAGS before
ACX_PTHREAD().

This commit also reverts 0ea7862e.
Allow -g and -O2 as the arguments of config/xclang.
Test aligned_alloc or posix_memalign with AC_LINK_IFELSE.

AC_COMPILE_IFELSE() won't work because C89 allows the
implicit declartion of functions.  We should test these
functions by linking the code with libc.
Move the #endif in pocl_utils.c.

It seems that #if on line 191 should only apply to
pocl_aligned_free(), thus we have to move the #endif.
Otherwise, pocl_create_event() and pocl_create_command()
won't be compiled and will result in link error.
Added 'long' keyword to the piglit suite as it takes very long to run (45-60mins).
Merge branch 'fix-memalign-check' of github.com:loganchien/pocl
Add option to link LLVM statically to libpocl when using LLVM via API.
Add workaround for using cmake-built LLVM.
Lump LLVM-related stuff together in configure.ac.