Guard against re-entering buffer initialization.

Resolves #518.

I don't know how to write a test for this.  It seems to be luck of the draw in libdl.