Add Commands to All Unlocked Notes

When using the Commands API, there is validation to ensure that commands are only added to unlocked notes. We fixed a bug that caused the incorrect state to be returned when multiple note state change events had occured (locking & unlocking).