Handle VE sending template parameter keys with leading/trailing spaces

Those would lead to a crash in the serializer before.

Change-Id: I3239807d6a4eb569545b4317aad32208036740a6