fix safe file handling in unit tests
# Description

Unit tests in a Python 3 environment yield `ResourceWarning` warnings like:

```
/home/travis/build/geopython/pywps/tests/test_inout.py:64: ResourceWarning: unclosed file <_io.FileIO name='/tmp/tmpwbpvbq0c' mode='rb'>
```
# Environment
- operating system: Ubuntu
- Python version: 3.4
- PyWPS version: master
- source/distribution
  - [x] git clone
  - [ ] Debian
  - [ ] PyPI
  - [ ] zip/tar.gz
  - [ ] other (please specify): 
- web server
  - [ ] Apache/mod_wsgi
  - [ ] CGI
  - [x] other (please specify): unit test runner
# Steps to Reproduce

``` bash
# in a Python 3 virtualenv
python -m unittest tests
```
# Additional Information

Initial discussion in #106.

Example can be found in current travis builds: https://travis-ci.org/geopython/pywps/jobs/111190874#L360

diff --git a/pywps/inout/basic.py b/pywps/inout/basic.py
index ef88557..bf2b979 100644
--- a/pywps/inout/basic.py
+++ b/pywps/inout/basic.py
@@ -74,6 +74,7 @@ class IOHandler(object):
         self.source = None
         self._tempfile = None
         self.workdir = workdir
+        self._stream = None
 
         self.valid_mode = mode
 
@@ -160,8 +161,11 @@ class IOHandler(object):
     def get_stream(self):
         """Get source as stream object"""
         if self.source_type == SOURCE_TYPE.FILE:
+            if self._stream and not self._stream.closed:
+                self._stream.close()
             from io import FileIO
-            return FileIO(self.source, mode='r', closefd=True)
+            self._stream = FileIO(self.source, mode='r', closefd=True)
+            return self._stream
         elif self.source_type == SOURCE_TYPE.STREAM:
             return self.source
         elif self.source_type == SOURCE_TYPE.DATA:
['pywps/inout/basic.py']