readline: strip ctrl chars for prompt width calc

Use regular expression to strip vt ansi escape codes from display when
calulating prompt display width and cursor position

Fixes #3860 and #5628.