Use shared pointer for endpoints and make copies when updating to
ensure thread safety of interface.

Change-Id: Ib12e29528770f5b4c72e6abf915850fc9a7dd947
Signed-off-by: Rob Adams <readams@readams.net>