Fix intermittent RMSD segfaults from invalid memory access

Fixes https://github.com/SimTk/msmbuilder/issues/348