linux: fix parsing of xrandr output for rare screen configurations

fixes not detecting the current mode if it is not the first on in its list
fixes crash when preferred mode is not current mode
Merge pull request #88 from tfg13/master

linux: fix parsing of xrandr output for rare screen configurations