Define cap 3 tasks before the "after" hook.

This fixes a bug in Capistrano 3.1, which must be more strict about when the tasks are defined.