add with_lock support to rails 3.0 and 3.1