An application for a writ of habeas corpus on behalf of a petitioner entitled to apply pursuant to this part shall not be entertained if it appears that the applicant has failed to apply for relief pursuant to this part with the chancery or circuit court in the county of commitment, unless the petitioner establishes that an application under this part would be inadequate or ineffective.