core: Add validation for locked template

Engine validation should be correlated with the GUI, for REST purposes.
The proposed fix does the following:
1. Adds a validation for template status when
updating a template.
2. Adds a memory lock when updating a template.

Change-Id: If4e25d5e9badd3169b2b5a65c3a7e745adadf379
Bug-Url: https://bugzilla.redhat.com/856515
Signed-off-by: Maor Lipchuk <mlipchuk@redhat.com>