Don't send 'undefined' when settings values are not defined.

Fixes #1365205
When deploying a service with undefined configuration values we were sending the string value "undefined" instead of nothing at all.
This was just a relocation to put the test in the proper spot.