reverse a string in place, converting to list and back