Also add 100ms sleep after exporting a new pin to give the OS time to set the correct owner and group