The writ of habeas corpus shall not be granted to a convicted person for a cause under Article 362, if he may appeal, or has done so and the appeal is pending.