I found the cause for the failure to unlock the drive. The program did not run with admin rights. When it's run as admin, wrting to the sd card works.
But I've run in to aother problem. When I try to boot the device from the sd card I get the following output on the usb debug interface:
HTLLCLLJ
Undefined InsHTLLCLLJ
Undefined InsHTLLCLLJ
Undefined InsHTLLCLLJ
Undefined InsHTLLCLLJ
Undefined InsHTLLCLLJ
Undefined InsHTLLCLLJ
The Undefined InsHTLLCLLJ part repeats forever.
Is something wrong with the boot image?