openssl: detect configuration changes and clean build tree accordingly (fixes #15067)