Run on JRuby

JRuby's PostgreSQL adapter doesn't define the wait_for_notify method like MRI's adapter does, so we had to define it ourselves.