Police in Taiwan have captured a fugitive who escaped from court-ordered psychiatric care, ending a four-day manhunt.