Fix improper error checking

Currently all (HTML/TEXT) spell checking logs an error (due commit b15cc7d) and HTML spell checking doesn't work (due commit cfe2fc8). Fix: ignore error="0" value from the returned XML as it isn't an error.
Performance improvement for searching in threaded mode. We can use
cached index now. Some other small improvements.
Merge branch 'master' of github.com:roundcube/roundcubemail
Improve code readability
Fix Junk folder alignment when it's nested in inbox folder.
Fix empty messages list when register_globals is enabled (#1489157)