fix rref for complex matrices (issue #1869)

See #1869.