Taiwan court extends former President's detention