Fix bug #1193763 - Save to device template generates exception for custom column names.
Merge branch 'kovidgoyal/master'
Fix cc bug in template editor

Fix an error when using the Template Editor to create a template that
uses custom columns. Fixes #1193763 [Private bug](https://bugs.launchpad.net/calibre/+bug/1193763)