Harden http_basic_authenticate_with against timing attacks

As has been disclosed previously, the current implementation of `http_basic_authenticate_with` uses `String#==` on both the username and password values.  Because `String#==` eventually involves a call to `memcmp` an attacker could potentially flood the site with requests and derive valid credentials.

To mitigate this risk this pull request rejigs the implementation to avoid short circuiting and also uses bcrypt (with a low cost) to make the response timings immune to iterative guessing.  We can't just drop in `secure_compare` because it's designed for byte arrays of a known and fixed size.

I'm submitting this for review because it would be good to hear from any security researchers whether:

1) we should use bcrypt, or any other hashing function
2) If there's anything else we should consider


A little more info would be useful here ... something like "Rails can add an extra protection against timing attacks but it needs the bcrypt gem. Please add it to your Gemfile and run bundle install".