Make the @@constants Hash thread-safe by wrapping it in a Mutex

When multiple threads are creating instances of
Faraday::RackBuilder::Handler, the `@@constants` hash may exhibit
unexpected behaviour, as the Hash class is not thread-safe in Ruby.

This commit wraps all writes to `@@constants` in a Mutex, thereby
ensuring mutual exclusion.