Fix Traymonitor does not close connections when login fails.

Fixes #303: Traymonitor does not close connections when login fails
Updated the MacOS packaging

This patch updates the MacOS packaging
to the new package tool pkgbuild.

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>