Knicks and Amar’e Stoudemire agree to contract buyout