Properly fix PYMIDIGetEndpointName() in all cases.

Note that this change will remove a trailing space from the endpoint
name in the case where endpointName is an empty string and deviceName
is nil.