Nearly 40 migrants were killed and more than 70 wounded in an air strike on their detention centre in a suburb of the Libyan capital Tripoli.