Only include environment in server name if set.

This prevents server names from ending with an underscore and blank
environment.