Fix improper handling of invalid resource.

Fix for https://github.com/m8rge/cwebsocket/issues/6 you can reproduce it by navigating to the URL directly in your browser.