fixing memory leaks and other issues reported by Coverity Prevent.

applemidi.c
1 Initialize sockaddr_in variable to clear sin_zero field to avoid undifined behavior.
2 Socket system call's return is validated before the call of bind.

 osc.c
1 Initialize sockaddr_in variable to clear sin_zero field to avoid undifined behavior.
1 Socket system call's return is validated.
1 Fix of memory allocated ( for size 52 bytes) in case of error scenario not deleted.


clock.c
1 fix for integer overflow issue.

device.c
1 Fix for Out-of-bounds write error(Overrunning array)

event.c
1 Fix of memory allocated ( for size 32 bytes) in case of error scenario not deleted.

port.c
2 Fix of dymaic sized allocated memory and for 32 bytes memory not deleted in error scenario.