fixed dll loading on linux
- and a memory access bug on context destruction