Fix make distcheck

The 'make distcheck' test has been failing since 5d9046b this commit
makes sure that the generated files {path,config}.js are put into
${buildir} instead of ${srcdir} and that they are properly cleaned up.

https://bugzilla.gnome.org/show_bug.cgi?id=723629