Add a function for thread-safe directory creation.
Add a function for thread-safe directory creation.

This is to be used in an upcoming commit.

smaccm/camkes-tool,smaccm/camkes-tool,smaccm/camkes-tool,smaccm/camkes-tool