Improve file type detection

Improves the file type detection so it maps both .rq and .ru files to
sparql file type (note that SPARQL Update syntax highlighting is not yet
added).

Also improves the detection so after writing a buffer if the file type
was not yet set to SPARQL do so on write.  This is useful when writing
newly created buffers