Return a boolean false if $app is false in index.php. 

Fixes static file loading when using PHP's builtin web server.  

Fixes #2330 and supersedes #2333.