use a single state variable in R.once implementation

This seems more elegant to me. :)