elasticsearch: move mkpath to post_install.

References #19994.