gold ends flat after three-session rise