Attempt to fix a race condition when creating Bucket objects

I think this ought to fix issue #380, and I think it's a more pythonic style too.

Any comments?