Fixed PDF viewer to correctly register file actions in root path

The files app can also be run from the root (index.php/) path which
wasn't detected properly.

Fixes #1409 

- [x] Fixed file actions
- [ ] There is another issue with OC.Router.registerLoadedCallback which isn't found so no doc appears in the viewer