Fix grunt test server from timing out on certain requests and throwing errros on invalid URL access

Steps:

1) Run the task with the keepalive option
2) Enter any localhost:4000/randomUrlHere in the browser
3) Notice, the requests times out. 

This is because we never end the request if we miss both if statements in the request handler.

In addition, if the requests happens to be prefixed with basePathForTests, then we will get an error server side. Instead we should return a 404.