Make sure accessor creation is thread safe

@tgoyne 

Hopefully fixes #1141