Run on JRuby

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