ALSARawmidi.StreamPair.open() has subdevice_id to select one of
substreams supported by the Rawmidi device. However, this parameter is
ignored and the first substream is always selected.
In ALSA rawmidi core, private structure associated to file descriptor
to control character device assists selection of rawmidi substream.
It requires to keep the file descriptor until the selected substream
is actually attached by open rawmidi character device.
Current implementation of libalsarawmidi is to close the file descriptor
before opening rawmidi character device. This is the cause of the issue.
This commit fixes the bug by keeping the file descriptor till opening
rawmidi character device.