Added test_metadata

- also prioritize ZAP metadata over ZMTP metadata in case application
  uses same names.
Fixed compile error in test_security_null