[refactor/fix] harden dmas

Various fixes related to dma API, missing validation on arguments,
pthread management and so on.
5 jobs for better-unit-tests in 5 minutes and 44 seconds (queued for 1 second)