Bump gem version to 2.40.0 + update rb/CHANGES