(Tiny breach of data model freeze) foreign key constraint added to custom_template_rendition's templateid column, pointing back to the id value in weblog_custom_template.  Some code bugs popped up as a result (where we were deleting the parent before deleting the children), also fixed in this commit.

git-svn-id: https://svn.apache.org/repos/asf/roller/trunk@1613555 13f79535-47bb-0310-9956-ffa450edef68