New home sales unexpectedly rose in June while the median price fell to its lowest level in almost a year.