Don't allow namespace conflicts in plans

When adding a template to a plan, check that the given namespace is
not already taken.

Change-Id: I4e6c61527b16d8a0a7c1ca18c62327c8ee2cadbf
Merge "Don't allow namespace conflicts in plans"