Bug 888086 - Use StringBuilder in sync/Utils.java

Finally got round to upstreaming this. Seems to pass unit testing. Hopefully I didn't maim the VCS...