perl: Fix warning about unsharing the $db variable