Fix for ticket:2981: Bitbucket hook doesn't work when specifying project

I basically just copied the fix from the ``github.py`` web hook dialect.
Sure, should I change this in the corresponding [github hook dialect](https://github.com/buildbot/buildbot/blob/master/master/buildbot/status/web/hooks/github.py)  as well? In general the implementation of the hook dialects does not seem very consistent, take a look at the [base hook](https://github.com/buildbot/buildbot/blob/master/master/buildbot/status/web/hooks/base.py). That one uses a dedicated function called firstOrNothing to extract the information. :confused: