Fix tasks: type column -> task_type

It turns out that Rails reserves columns named "type" for single-table
inheritance. Rename type to task_type to work around it.