PNaClContext: fix reference counting bugs