South Korean President Yoon Suk Yeol has been banned from leaving the country over a failed attempt at imposing martial law.