Fix a bug in trimwhitespace() and make it's result more consistent.

This was found while using trimwhitespace() to parse the event
definition files.

'out' was being used before it was initialized.  We don't need to
initialize it if we're returning anyway, so just delete the line.

Rather than having trimwhitespace() return NULL if the string is
trimmed to empty, instead return an empty string so that no special
NULL-case handling is required by the caller.

Also, since trimwhitespace() malloc's the memory returned in the
result, the caller is responsible for cleanup to prevent leaks.
I believe the settings code still needs to do this.