We should fix error handling in this function instead of controlling process lifetime. For now it is only ThinLocal backend that uses this function but the process control should be handled locally in the backend implementation.
get_lpd_tunnel_port() internally calls get_last_public_sessioninfo() which also does an sys.exit() upon errors.