tm: safety check for user_agent_header value

- don't add the header in local generated requests if the value is empty