closing streams correctly to avoid resource leaks

Hi,

we had lots of trouble running azkaban services for a longer time. We found out that lots of streams are not closed when required. Especially streams of processes causes "too many open files exception" on our servers.

So this request will add missing closing of streams (mostly file streams) and will add try { ... } finally { ... } pattern.

Best regards