Fix pool.query not invoking callback on connection error

fixes #872