NASA spacecraft avoids potential collision with Martian moon