[feature] add generic copy operator for layouts

Add a function to create a layout from an existing one. We call it
duplicate to avoid the confusion with dma copies.

- ownership consistent with destroy operator: underlying layouts are
  also copied
- data is copied by the implementation, and the generic code takes care of
  the ops pointer.
8 jobs for layout-copy in 3 minutes and 25 seconds (queued for 2 seconds)