KeyError generated when using a provider template

The function for registering information about provider templates
referenced via urls is causing a KeyError. This patch checks for
checks for the existance of the specified resource befor removing
from the registry. This will prevent KeyErrors in stacks referencing
provider templates that are persisted in the database.

Partial-Bug: #1288541
Change-Id: Id58d5bfeac896d0d52eb4262b25eff3a5fe2238c
Merge "KeyError generated when using a provider template"