tests/unix_sockets: Return a duplicate in get_resource