Most passengers have been freed after a man hijacked an Egyptian plane from Alexandria and forced it to land in Cyprus.