The utility blocks for no apparent reason when the MIDI device is in use by another process. The culprit seems to be line 30 in midi.c:
r = snd_rawmidi_open(&handle_in, &handle_out, device, 0);
If SND_RAWMIDI_NONBLOCK is set as the flags, then the utility properly exits with a human readable error:
r = snd_rawmidi_open(&handle_in, &handle_out, device, SND_RAWMIDI_NONBLOCK );