Made _get_host_port thread safe

Changed _get_host_port thread safe by using bson_malloc rather than using static memory for returned memory buffer