Egypt offers military training to Libya, cites Islamic State threat