Use $wp_filesystem to rename the theme folder - adapted from @GaryJones