Transfer uid and gid to volume. Fixes #1737.