setup: use appropriate hooks to work around CFFI problems

We replace the previous hacks by a more robust solution documented here:
 https://caremad.io/2014/11/distributing-a-cffi-project/