gpio_drv: prevent copy of non-copyable objects

Follow up fix for commit 0b7ea4abab
Ref #1093