Ailing Mubarak appears in courtroom