build,tests: Fix detection of have_lock_optimization.
* configure.ac: Lock optimization (without sys/single_threaded.h) is only known to work on GNU system, using weak symbol.
- Fixes-commit: 50e0f32b19356fd7c64c799192379ff2204cd8a3
- GnuPG-bug-id: T5699
- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>