Reimplement jquery-rails lock on 1.0.19

Signed-off-by: Jeremy Ho <jujaga@gmail.com>