This is a first attempt of fixing the interrupt race mess
Lots of fixes and rewrite. This version is really stable.
Merge branch 'work/fixing-race'