Attempting to fix another compiler optimization bug

This addresses #13 when compiled from R. It seems like R has some other flags when compiling that trigger the same bug in _get_all_nns and that it optimizes away two other loops. Removing the loops and using vector::insert resolves the issue