[rst-mode] LaTex/Python inner mode glitches

The were some minor issues w.r.t. where exactly an `stex` or `python` inner mode starts and where the outer `rst` mode resumes; fixed.