Minor bug fixes for iRODS connection setup

Hi,

I have tried deploying this code and ran into several minor issues, primarily that the home directory was getting set wrong, to "/(null)/home//(nu".

I had a look and made a few small fixes - these are:
* free user_name only after last use
* set zone only when defined in mapped username
* Remove compile warnings: fix type of port.

I hope you can accept these fixes as a contribution.

Please let me know if you'd like me to clarify any of the code changes.

Cheers,
Vlad

-- 
Vladimir Mencl, Ph.D.
E-Research Services and Systems Consultant
BlueFern Computing Services
University of Canterbury
Christchurch
New Zealand

http://www.bluefern.canterbury.ac.nz
mailto:vladimir.mencl@canterbury.ac.nz