resourcet: add 'dup' function

dup function dublicates resource into outter monad, so it will
be freed there