Fix by removing trailing slash when performing `cp -a` into cache. Add test to confirm fix. Resolves nrwl/nx#10549