core: address several advertised address related issues

	* properly duplicate buffers into shared memory when required
	* keep the advertised address of the first branch as a default for
	  future branches
	* also allow set_advertised_port() to receive any kind of parameter
	  (int, string, int pvar, str pvar...)

Credits for reporting and helping with troubleshooting to GitHub user contact2malay