Fix autodetection of cosl(), sinl()

Autoconf must have changed since we last looked.  Thanks
Åke Sandgren for the fix.
Be more careful in detecting sinl(), cos(), memalign(), posix_memalign()
group together AC_CHECK_DECLS for functions in stdlib.h
Merge remote-tracking branch 'upstream/master'