Fix a couple of annoyances in Python text editing.

Fix bad dirty detection.
Fix inability to backspace from first nonspace character in a line.