fixed sparql parser bug with pnames followed by a dot

Previously, bugs would occur when triple-patterne did not have
whitespace between a pname and the terminating dot:

?s ?p foaf:knows.

would parse into a uriref of "http://xmlns.com/foaf/0.1/knows."

The optional clause of the PN_LOCAL production was in the wrong place,
fixing it was non-trivial, since pyparsing cannot backtrack.

I replaced the whole production with a regex, parsing pnames should now
also be much faster (not that it matters greatly)

Thanks to balkian on irc for spotting!