Fix 100% CPU bugs

Fixes  #2581, #2526, #2506,  #2021

Guessit locks up with several variations of a path. These patches make sure Guessit never receives such paths.