Eagerly change the listeners count
Eagerly change the listeners count

Summary:
While working with `RCTEventEmitter` I noticed that if an event is emitted before `_listenerCount` is updated, it will not go through because the listeners count hasn't been updated. Moving the count update before the invokation of `startObserving` and `stopObserving` fixes the issue. Same way if you remove the last listener and an event is fired before the count is updated (while it shouldn't be fired).

**Test plan (required)**

An easy test to demonstrate it is to implement `startObserving` to synchronously fire an event. Without the change, a warning is thrown, with the change, the event is fired. Not very strong on Obj-C here and I didn't know how to mock out the native stuff. Would be glad to write a failing unit test tho :)
Closes https://github.com/facebook/react-native/pull/11907

Differential Revision: D4738965

Pulled By: javache

fbshipit-source-id: cf175051be5b9c5de761d3dcd290560e1639b05e

exponentjs/react-native,thotegowda/react-native,jasonnoahchoi/react-native,pandiaraj44/react-native,thotegowda/react-native,rickbeerendonk/react-native,gilesvangruisen/react-native,Livyli/react-native,hammerandchisel/react-native,rickbeerendonk/react-native,imDangerous/react-native,negativetwelve/react-native,Maxwell2022/react-native,alin23/react-native,adamjmcgrath/react-native,myntra/react-native,happypancake/react-native,formatlos/react-native,orenklein/react-native,Ehesp/react-native,imDangerous/react-native,hoangpham95/react-native,hoastoolshop/react-native,mironiasty/react-native,adamjmcgrath/react-native,rickbeerendonk/react-native,gilesvangruisen/react-native,cdlewis/react-native,hoangpham95/react-native,ndejesus1227/react-native,cpunion/react-native,PlexChat/react-native,brentvatne/react-native,forcedotcom/react-native,ptmt/react-native-macos,facebook/react-native,cdlewis/react-native,negativetwelve/react-native,forcedotcom/react-native,imDangerous/react-native,jevakallio/react-native,csatf/react-native,ptomasroos/react-native,pandiaraj44/react-native,facebook/react-native,adamjmcgrath/react-native,thotegowda/react-native,Ehesp/react-native,csatf/react-native,Guardiannw/react-native,arthuralee/react-native,makadaw/react-native,ptomasroos/react-native,happypancake/react-native,hoangpham95/react-native,makadaw/react-native,chnfeeeeeef/react-native,Maxwell2022/react-native,mironiasty/react-native,brentvatne/react-native,farazs/react-native,shrutic123/react-native,ptomasroos/react-native,peterp/react-native,hammerandchisel/react-native,mironiasty/react-native,Maxwell2022/react-native,Swaagie/react-native,aljs/react-native,negativetwelve/react-native,adamjmcgrath/react-native,skevy/react-native,Bhullnatik/react-native,myntra/react-native,hammerandchisel/react-native,ndejesus1227/react-native,formatlos/react-native,imDangerous/react-native,shrutic123/react-native,facebook/react-native,thotegowda/react-native,chnfeeeeeef/react-native,janicduplessis/react-native,cdlewis/react-native,negativetwelve/react-native,Swaagie/react-native,formatlos/react-native,gilesvangruisen/react-native,hoastoolshop/react-native,rickbeerendonk/react-native,exponent/react-native,ndejesus1227/react-native,Ehesp/react-native,Maxwell2022/react-native,jevakallio/react-native,ptmt/react-native-macos,chnfeeeeeef/react-native,tszajna0/react-native,janicduplessis/react-native,formatlos/react-native,exponentjs/react-native,kesha-antonov/react-native,thotegowda/react-native,dikaiosune/react-native,shrutic123/react-native,kesha-antonov/react-native,csatf/react-native,peterp/react-native,cpunion/react-native,imDangerous/react-native,exponent/react-native,makadaw/react-native,javache/react-native,aljs/react-native,negativetwelve/react-native,Guardiannw/react-native,lprhodes/react-native,imDangerous/react-native,farazs/react-native,adamjmcgrath/react-native,brentvatne/react-native,skevy/react-native,makadaw/react-native,Livyli/react-native,exponentjs/react-native,Bhullnatik/react-native,makadaw/react-native,Bhullnatik/react-native,kesha-antonov/react-native,cdlewis/react-native,csatf/react-native,clozr/react-native,skevy/react-native,hammerandchisel/react-native,farazs/react-native,forcedotcom/react-native,formatlos/react-native,Guardiannw/react-native,happypancake/react-native,exponent/react-native,makadaw/react-native,hoastoolshop/react-native,Ehesp/react-native,orenklein/react-native,cdlewis/react-native,peterp/react-native,negativetwelve/react-native,javache/react-native,janicduplessis/react-native,Guardiannw/react-native,hoangpham95/react-native,ndejesus1227/react-native,formatlos/react-native,clozr/react-native,PlexChat/react-native,Maxwell2022/react-native,gilesvangruisen/react-native,farazs/react-native,clozr/react-native,cpunion/react-native,happypancake/react-native,ptmt/react-native-macos,Maxwell2022/react-native,skevy/react-native,rickbeerendonk/react-native,exponentjs/react-native,hoastoolshop/react-native,hammerandchisel/react-native,frantic/react-native,arthuralee/react-native,javache/react-native,tsjing/react-native,Ehesp/react-native,tszajna0/react-native,Swaagie/react-native,mironiasty/react-native,happypancake/react-native,csatf/react-native,ptomasroos/react-native,adamjmcgrath/react-native,javache/react-native,forcedotcom/react-native,peterp/react-native,happypancake/react-native,lprhodes/react-native,alin23/react-native,hoangpham95/react-native,happypancake/react-native,dikaiosune/react-native,peterp/react-native,hoastoolshop/react-native,ptmt/react-native-macos,jevakallio/react-native,frantic/react-native,Bhullnatik/react-native,farazs/react-native,doochik/react-native,ptomasroos/react-native,shrutic123/react-native,tszajna0/react-native,Bhullnatik/react-native,cpunion/react-native,brentvatne/react-native,clozr/react-native,imDangerous/react-native,PlexChat/react-native,dikaiosune/react-native,myntra/react-native,cpunion/react-native,happypancake/react-native,pandiaraj44/react-native,alin23/react-native,frantic/react-native,mironiasty/react-native,janicduplessis/react-native,kesha-antonov/react-native,hoastoolshop/react-native,Livyli/react-native,PlexChat/react-native,makadaw/react-native,jasonnoahchoi/react-native,janicduplessis/react-native,rickbeerendonk/react-native,Guardiannw/react-native,aljs/react-native,javache/react-native,dikaiosune/react-native,myntra/react-native,tszajna0/react-native,forcedotcom/react-native,doochik/react-native,tszajna0/react-native,myntra/react-native,PlexChat/react-native,negativetwelve/react-native,Swaagie/react-native,shrutic123/react-native,frantic/react-native,negativetwelve/react-native,peterp/react-native,exponentjs/react-native,forcedotcom/react-native,doochik/react-native,aljs/react-native,alin23/react-native,cpunion/react-native,kesha-antonov/react-native,brentvatne/react-native,skevy/react-native,adamjmcgrath/react-native,tsjing/react-native,pandiaraj44/react-native,ndejesus1227/react-native,Bhullnatik/react-native,kesha-antonov/react-native,jasonnoahchoi/react-native,exponent/react-native,jasonnoahchoi/react-native,doochik/react-native,csatf/react-native,formatlos/react-native,hoastoolshop/react-native,hammerandchisel/react-native,lprhodes/react-native,Swaagie/react-native,gilesvangruisen/react-native,Guardiannw/react-native,Livyli/react-native,farazs/react-native,myntra/react-native,clozr/react-native,brentvatne/react-native,gilesvangruisen/react-native,tsjing/react-native,myntra/react-native,facebook/react-native,lprhodes/react-native,Ehesp/react-native,frantic/react-native,jevakallio/react-native,myntra/react-native,tsjing/react-native,exponent/react-native,rickbeerendonk/react-native,lprhodes/react-native,jasonnoahchoi/react-native,rickbeerendonk/react-native,exponent/react-native,clozr/react-native,jevakallio/react-native,jevakallio/react-native,Swaagie/react-native,myntra/react-native,chnfeeeeeef/react-native,Livyli/react-native,Livyli/react-native,skevy/react-native,kesha-antonov/react-native,mironiasty/react-native,Guardiannw/react-native,orenklein/react-native,kesha-antonov/react-native,Ehesp/react-native,mironiasty/react-native,alin23/react-native,aljs/react-native,makadaw/react-native,arthuralee/react-native,tsjing/react-native,kesha-antonov/react-native,ptmt/react-native-macos,ndejesus1227/react-native,Bhullnatik/react-native,doochik/react-native,chnfeeeeeef/react-native,javache/react-native,aljs/react-native,ptmt/react-native-macos,ptmt/react-native-macos,cdlewis/react-native,javache/react-native,tsjing/react-native,dikaiosune/react-native,shrutic123/react-native,ptomasroos/react-native,orenklein/react-native,exponentjs/react-native,makadaw/react-native,ndejesus1227/react-native,csatf/react-native,arthuralee/react-native,thotegowda/react-native,hoangpham95/react-native,arthuralee/react-native,cpunion/react-native,facebook/react-native,alin23/react-native,aljs/react-native,Guardiannw/react-native,ptomasroos/react-native,jasonnoahchoi/react-native,janicduplessis/react-native,skevy/react-native,formatlos/react-native,tszajna0/react-native,clozr/react-native,farazs/react-native,ptomasroos/react-native,doochik/react-native,jevakallio/react-native,pandiaraj44/react-native,peterp/react-native,exponentjs/react-native,pandiaraj44/react-native,thotegowda/react-native,Maxwell2022/react-native,gilesvangruisen/react-native,orenklein/react-native,exponentjs/react-native,cdlewis/react-native,formatlos/react-native,forcedotcom/react-native,brentvatne/react-native,adamjmcgrath/react-native,facebook/react-native,lprhodes/react-native,PlexChat/react-native,facebook/react-native,facebook/react-native,dikaiosune/react-native,orenklein/react-native,lprhodes/react-native,negativetwelve/react-native,exponent/react-native,chnfeeeeeef/react-native,cdlewis/react-native,tsjing/react-native,exponent/react-native,Livyli/react-native,brentvatne/react-native,hoangpham95/react-native,doochik/react-native,hammerandchisel/react-native,ptmt/react-native-macos,shrutic123/react-native,chnfeeeeeef/react-native,hoangpham95/react-native,mironiasty/react-native,alin23/react-native,Maxwell2022/react-native,dikaiosune/react-native,janicduplessis/react-native,jevakallio/react-native,farazs/react-native,rickbeerendonk/react-native,shrutic123/react-native,doochik/react-native,PlexChat/react-native,doochik/react-native,peterp/react-native,Livyli/react-native,csatf/react-native,orenklein/react-native,jevakallio/react-native,cpunion/react-native,javache/react-native,javache/react-native,chnfeeeeeef/react-native,Swaagie/react-native,mironiasty/react-native,skevy/react-native,PlexChat/react-native,Ehesp/react-native,Swaagie/react-native,jasonnoahchoi/react-native,tsjing/react-native,tszajna0/react-native,Bhullnatik/react-native,tszajna0/react-native,dikaiosune/react-native,orenklein/react-native,lprhodes/react-native,janicduplessis/react-native,facebook/react-native,hammerandchisel/react-native,forcedotcom/react-native,aljs/react-native,ndejesus1227/react-native,pandiaraj44/react-native,jasonnoahchoi/react-native,hoastoolshop/react-native,cdlewis/react-native,gilesvangruisen/react-native,alin23/react-native,imDangerous/react-native,clozr/react-native,brentvatne/react-native,farazs/react-native,thotegowda/react-native,pandiaraj44/react-native