Private Package dll gives "Access is denied"

Make sure the library is executable, I think this should do the trick:

lib = "/path/to/library.dll"
chmod(lib, filemode(lib) | 0o755)