Error make test if --enable-tests isn't set and fix a possible hang in the unit tests (doTi meout would never call the callback)