Make sure _get_or_create_build_dir() is safe to call twice.