Library_contents API: Fix permissions and dataset ref on LD delete