add sanity checks to functions
declare _BSD_SOURCE to enable several features
add threaded tests
rename functions (smq_) and use semaphores

switch over from mutexes to semaphores
update CFLAGS for test suite

don't optimise and add debug symbols