Finaliser tasks

As discussed on [this mailing list thread](http://gradle.1045684.n5.nabble.com/Task-finalisers-implementation-td5711070.html).