Fix undefined left shift with signed ints

Caught by Clang's -fsanitize=shift.  A small unsigned int was promoted,
according to C's regular promotion rules, to a signed int, it was then
left shifted.  This sometimes pushed a 1 into the sign bit, which is
undefined behaviour.  Fix by using unsigned temporaries.
Simplify passing of linker flags to try_compile calls

In commit d7bd02b6 (Modify CHECK_C_SOURCE_* checks to fix builds using
Visual Studio 12, 2013-02-01), commit e3d14342 (Set use of /SAFESEH linker
flag for all LIBARCHIVE_CHECK_C_SOURCE_* checks, 2013-02-01), and commit
58dc42aa (Fix checks for crypto algorithms in Visual Studio builds,
2013-02-01) we introduced and used custom copies of the CMake
CheckCSource(Compiles|Runs) modules in order to pass linker flags to
try_compile calls.  CMake has an issue tracker entry about passing
CMAKE_*_LINKER_FLAGS to try_compile calls:

  http://www.cmake.org/Bug/view.php?id=14066

Discussion there suggests a much simpler workaround: pass the flags
through the LDFLAGS environment variable.  Remove our custom check
macros and use the simpler workaround instead.
Merge branch 'no-signed-shift'
Merge branch 'simplify-link-flags'