CRAFTERCMS-799

Fixed bug that was allowing self dependency for templates (templates adds dependency to itself)