set default protocol to UDP
add stunc_ prefix to terminate_if_done()
move stunc_close to main()