With private fitting rooms, members-only stores and clever apps, U.S. department stores are reinventing their old and tested loyalty programs to fend off the challenge from e-commerce giant Amazon.com Inc and other online rivals.