Fix password prompt removal from stdout/err capture buffers

The capture parameter to the OutputLooper is passed by reference. The
try_again case in the OutputLooper which removes try-again strings from
the capture buffer must do the removal in-place, i.e. not replace
self.capture with another object.

Moreover, password promps have trailing newlines. These were not
removed from the capture buffers at all.