ESMValTool crashes when recipe uses ancestors
**Describe the bug**
The tool crashes with this error when I run a recipe which uses the `ancestors` key, other recipes run fine (I tested the python and NCL example):

```
Traceback (most recent call last):
  File "/miniconda3/envs/mlr/lib/python3.7/multiprocessing/pool.py", line 121, in worker
    result = (True, func(*args, **kwds))
  File "/ESMValCore/esmvalcore/_task.py", line 684, in _run_task
    output_files = task.run()
  File "/ESMValCore/esmvalcore/_task.py", line 238, in run
    self.output_files = self._run(input_files)
  File "/ESMValCore/esmvalcore/_task.py", line 454, in _run
    f for f in input_files
  File "/ESMValCore/esmvalcore/_task.py", line 455, in <listcomp>
    if f.endswith('.yml') or os.path.isdir(f)
AttributeError: 'PosixPath' object has no attribute 'endswith'
```

Example: [`ESMValTool/esmvaltool/recipes/examples/recipe_python_object_oriented.yml`](https://github.com/ESMValGroup/ESMValTool/blob/master/esmvaltool/recipes/examples/recipe_python_object_oriented.yml).

Probably related to #528.

(Using the most recent `master` branches of ESMValTool and ESMValCore)
diff --git a/esmvalcore/_task.py b/esmvalcore/_task.py
index c20aebeb4..fe5136c7e 100644
--- a/esmvalcore/_task.py
+++ b/esmvalcore/_task.py
@@ -268,7 +268,7 @@ class DiagnosticTask(BaseTask):
         super().__init__(ancestors=ancestors, name=name)
         self.script = script
         self.settings = settings
-        self.output_dir = Path(output_dir)
+        self.output_dir = output_dir
         self.cmd = self._initialize_cmd()
         self.log = Path(settings['run_dir']) / 'log.txt'
         self.resource_log = Path(settings['run_dir']) / 'resource_usage.txt'
['esmvalcore/_task.py']