Change way of closing silently because newer old method is deprecated
Change library to encode Uris

See also #517

* add encoding of characters '+' and '/' to savely use
	URIs as whole URL and as URL query