Search upwards if the tasks directory isn't found locally.

Fixes #1211.

It actually fix some cases that aren't handled by #1229.