You didn't have any risk of getting syphilis by being masturbated by another person would be if that person has syphilis in the second stage of the infection and she/he has a rash on her/his hands. Honestly, I don't think that person would be there to masturbate anyone is she/he had a rash on the hands.
Also, any test 3 months after the encounter would be accurate. So, your test for syphilis shows that you don't have than infection.
All the best.