probably fixes handling of dependencies in ctypeswriter

This fixed the wrong dependencies for ctypes. All tests pass fine with it.
However I didn't read through all of the code, so this change might as well be completely wrong.