cmitls: Refactor getting and setting the TLS segment pointer