Fix % encoding bug at end of string

Fix endless loop if the urlDecode method is called with a string that ends with a '%' without two following chars.