applemidi.c: Fix _applemidi_connect() err handling

The return variable `result` is initialized with `0`, and is not updated in case the system call `socket()` call fails. In this case, the function `_applemidi_connect()` returns 0, a success value.

Fix this, by error checking for failure of `socket()` call. 
We set `result = -1;` in error case, because this is what is checked for, in `MIDIDriverAppleMIDICreate()` line 311.