Simplify task auth logic

The logic for looking up a task was looking up the project
multiple times.  Simplify it, so that it just happens once,
and includes whether the user is the owner of the
task or the project in the resulting object.