MDL-40546 send proper caching headers when $CFG->cachejs = 0

This should help developers writing old style JS that is served via lib/javascript.php.