When working with physical MIDI devices, an *input* stream is used for reading from *output* port of the device, and vice versa. Thus, using "input" and "output" without specifying whether it's a stream or a port is confusing. Clarify names of counter variables, and fix a couple of comments that were incorrect due to this confusion. No functional changes. Change-Id: If561eaca4bade94e9296d2c703c9fcebc91296e2