avoid memory leak in mtx_destroy for taskqueue, sanity check name argument, and fix what would've been compile errors