MuseScore 30/06/2015: Random pitch shift

I improved rebuildMidiMapping() function by implementing a 'repair' of partially-initialized mappings. There are cases when MIDI port or channel could be missing, for example while importing MIDI and MusicXML files. Some software doesn't export information about MIDI port, so we have to handle this case.
Also, as I wrote in previous posts, MusicXML file format allows to write MIDI port in a range 1-16, so in some cases MuseScore is not able to export MIDI port information. Thus, it will export only MIDI channel and therefore we should fix the mapping.

There was an interesting feature proposed in #musescore IRC: random pitch shift by a few cents to humanize the playback of notes. This could work well for drums, violins (and other string instrument), detuned piano and so on.