Returns a copy of an object with its keys sorted