Prevent ajax behavior from being added to page multiple times.

From #6772.