Closing/destroying files after reading/writing?

@marpet Sorry for the lack of response.
I amended my script to call dispose method. Later, I would like to amend my functions, so that they will return product not file path.

Unfortunately, I still receive an error message when calling getSigma and as I check, this error occurs in SNAP Desktop as well. I created separate thread for that: http://forum.step.esa.int/t/java-lang-nullpointerexception-when-using-calibration-operator-on-beam-dimap-file/3099