Fix matching for volume paths in cp

Fixes #9787
I'm not sure, but original bug was about bind-mount volumes.