Fix bug #6528: Infinite loop in 3.x searchreplace plugin in MSIE 9/10

This patch fixes a potential infinite loop in MSIE 9/10 while using the searchreplace plugin to change the case.

See http://www.tinymce.com/develop/bugtracker_view.php?id=6528