security: don't crash if received segment lacks KeyLocator

And while at it:
 * move afterSegmentValidated() to a lambda
 * remove unused loopback parameter from setInterestFilter()
 * delete unused clear() method
 * improve logging
 * prevent building without PSync if tests are enabled, since that
   configuration is currently unsupported

Change-Id: I930744296d3fa295787c16e6829d1dc27b06a195
diff --git a/wscript b/wscript
index 74dcee0..f070b74 100644
--- a/wscript
+++ b/wscript
@@ -94,9 +94,12 @@
                        uselib_store='SVS', pkg_config_path=pkg_config_path)
 
     if not any((conf.options.with_chronosync, conf.options.with_psync, conf.options.with_svs)):
-        conf.fatal('Cannot compile without any Sync protocol. '
+        conf.fatal('Cannot compile without any Sync protocol.\n'
                    'Specify at least one of --with-psync or --with-svs or --with-chronosync')
 
+    if conf.env.WITH_TESTS and not conf.options.with_psync:
+        conf.fatal('--with-tests requires --with-psync')
+
     conf.check_compiler_flags()
 
     # Loading "late" to prevent tests from being compiled with profiling flags