kernel/poll: fix registrations that were not always cleared
kernel/poll: fix registrations that were not always cleared

Poll events were getting registered even when polling conditions had
already been met, but events with conditions met did not register and
did not increment the number of events registered. This caused a
possible discrepancy between the number of events registered and the
position of the last event registered in the events array.

As soon as one event condition is met, the next ones in the array should
not get registered even if their condition is not met. This is what the
code does now.

Change-Id: Ibcc3b135ec9d3cf463beb9da3f641fec962b34bf
Signed-off-by: Benjamin Walsh <2c289a12a296c7195a7f06fd0f3fe281728960bf@gmail.com>

nashif/zephyr,bigdinotech/zephyr,GiulianoFranchetto/zephyr,aceofall/zephyr-iotos,tidyjiang8/zephyr-doc,erwango/zephyr,explora26/zephyr,punitvara/zephyr,rsalveti/zephyr,finikorg/zephyr,erwango/zephyr,rsalveti/zephyr,zephyriot/zephyr,Vudentz/zephyr,galak/zephyr,holtmann/zephyr,aceofall/zephyr-iotos,aceofall/zephyr-iotos,explora26/zephyr,punitvara/zephyr,runchip/zephyr-cc3200,ldts/zephyr,runchip/zephyr-cc3200,runchip/zephyr-cc3220,rsalveti/zephyr,pklazy/zephyr,aceofall/zephyr-iotos,pklazy/zephyr,aceofall/zephyr-iotos,bigdinotech/zephyr,finikorg/zephyr,fractalclone/zephyr-riscv,Vudentz/zephyr,punitvara/zephyr,sharronliu/zephyr,galak/zephyr,sharronliu/zephyr,runchip/zephyr-cc3220,tidyjiang8/zephyr-doc,mbolivar/zephyr,Vudentz/zephyr,pklazy/zephyr,GiulianoFranchetto/zephyr,Vudentz/zephyr,runchip/zephyr-cc3200,fractalclone/zephyr-riscv,tidyjiang8/zephyr-doc,zephyrproject-rtos/zephyr,punitvara/zephyr,explora26/zephyr,tidyjiang8/zephyr-doc,sharronliu/zephyr,fractalclone/zephyr-riscv,mbolivar/zephyr,runchip/zephyr-cc3220,pklazy/zephyr,galak/zephyr,zephyriot/zephyr,ldts/zephyr,fbsder/zephyr,bboozzoo/zephyr,bigdinotech/zephyr,Vudentz/zephyr,rsalveti/zephyr,holtmann/zephyr,punitvara/zephyr,explora26/zephyr,rsalveti/zephyr,fbsder/zephyr,kraj/zephyr,zephyriot/zephyr,runchip/zephyr-cc3200,kraj/zephyr,ldts/zephyr,GiulianoFranchetto/zephyr,zephyrproject-rtos/zephyr,GiulianoFranchetto/zephyr,nashif/zephyr,finikorg/zephyr,zephyriot/zephyr,GiulianoFranchetto/zephyr,kraj/zephyr,kraj/zephyr,Vudentz/zephyr,explora26/zephyr,kraj/zephyr,fractalclone/zephyr-riscv,galak/zephyr,pklazy/zephyr,bigdinotech/zephyr,holtmann/zephyr,erwango/zephyr,ldts/zephyr,runchip/zephyr-cc3220,tidyjiang8/zephyr-doc,bboozzoo/zephyr,zephyriot/zephyr,holtmann/zephyr,finikorg/zephyr,erwango/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,mbolivar/zephyr,sharronliu/zephyr,fbsder/zephyr,fractalclone/zephyr-riscv,bboozzoo/zephyr,mbolivar/zephyr,sharronliu/zephyr,erwango/zephyr,galak/zephyr,bigdinotech/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,mbolivar/zephyr,nashif/zephyr,holtmann/zephyr,runchip/zephyr-cc3220,fbsder/zephyr,bboozzoo/zephyr,runchip/zephyr-cc3200,fbsder/zephyr,ldts/zephyr,bboozzoo/zephyr,finikorg/zephyr