Clear up referer when adding upload_files cap

The trick used to dynamically add the upload_files cap for non-admin
users involves checking to make sure that we're on an Docs create/edit
page by checking $_SERVER['HTTP_REFERER']. (It's necessary to check the
referer because the actual check happens on an async call to
async-upload.php.) However, when creating a Doc from the context of a
group, an additional URL param is added to HTTP_REFERER, with the result
that the $referer == create_url check fails.

I've fixed the issue by doing some cleanup on the referer before doing
the necessary comparisons. In particular, all URL params are now being
stripped. A note that this will break things if at some future point the
plugin becomes compatibile with non-pretty-permalink setups.

Fixes #355