Thanks, ctbale, you saved me a lot of time.
I had the exact same weird problem: doors would lock as soon as I unlatched the driver's side door (it was actually the dome light making it happen, as you wrote). After taking my driver's side door panel apart and finding nothing wrong, I googled it and found your fix. What you described worked for me. I made a video of the procedure for anyone else who encounters this:
I didn't find any obvious corrosion, but there was a some dirt and dust that I blew out. Removing and reinstalling the connector seemed to do the trick.
Anyway, thanks again for sharing your fix!