S. Korea’s impeached president attends court to fight detention extension