At least 27 people have been killed after two migrant boats attempting to cross the Mediterranean sank off the coast of Tunisia, authorities say.