Fix: Corrected display of "login" on status page

This corrects the creation of <authenticator> in the status output
and this way fixes the display of login link on status page.
Closes #1939
Fix: Added missing includes
Fix: memory leak now freeing null_device and global source_password
Fix: memory leak, now also releasing reglist[] members
Fix: memory leak and race condition fix
Fix: avoid segfault by generating <metadata> for relays
Merge branch fix for <metadata> of relays.
Merge branch 'master' into ph3