Bump version to 4.0.40 and upgrade preferred Nginx version to 1.4.7.