Add update state protocol method when the user is about to close the View Controller

Signed-off-by: Nikhil Nigade <nikhil@dezinezync.com>