Fix sync_folder_to_container prefix pathing bug

This is an alternative solution to what is proposed in #473 that reduces the amount of memory shuffling due to not re-assigning a variable on every loop.