templatematch: Add locking around filter properties
templatematch: Add locking around filter properties

To allow changing the properties (e.g. the pattern to match) while the
pipeline is playing.

* gst_element_post_message is moved outside of the lock, because it will
call into arbitrary user code (otherwise, if that user code calls into
gst_templatematch_set_property on this same thread it would deadlock).

* gst_template_match_load_template: If we fail to load the new template
we still unload the previous template, so this element becomes a no-op
in the pipeline. The alternative would be to keep the previous template;
I believe unloading the previous template is a better choice, because it
is consistent with the state this element would be in if it fails to
load the very first template at start-up.

wmanley/stb-tester,martynjarvis/stb-tester,martynjarvis/stb-tester,LewisHaley/stb-tester,martynjarvis/stb-tester,wmanley/stb-tester,LewisHaley/stb-tester,wmanley/stb-tester,stb-tester/stb-tester,LewisHaley/stb-tester,stb-tester/stb-tester,LewisHaley/stb-tester,stb-tester/stb-tester,martynjarvis/stb-tester,martynjarvis/stb-tester,wmanley/stb-tester,LewisHaley/stb-tester,LewisHaley/stb-tester,LewisHaley/stb-tester,martynjarvis/stb-tester,wmanley/stb-tester,martynjarvis/stb-tester,stb-tester/stb-tester