Correct override_urls check in Api (closes #692)

This applies the same change which #516 made to Resource to only issue
the deprecation warning when override_urls() actually returns something.

This also changes the logic in both locations to avoid calling
override_urls() more than once
Handle malformed HTTP Accept values

Some clients cause tastypie to return a 500 error because they send a request
with an HTTP Accept header which contains an invalid MIME type (e.g. any value
without a "/" other than "*", which mimeparse handles).

determine_format() now raises BadRequest any time mimeparse fails.
Resources now handle this by returning HTTP 400 immediately rather than
the normal error response
wrap_view: handle BadRequest exceptions gracefully
PEP-8: replace legacy has_key() with ``foo in bar``
Merge pull request #819 from acdha/692-correct-override_urls-warning

Correct override_urls check in Api (closes #692)
Merge pull request #519 from acdha/robust-format-negotiation

Altered ``determine_format`` to handle malformed HTTP Accept values.
Made the backward-incompatible doc a bit more readable & included SHAs.