Update changelog and version number for pre-release 0.9.40.