Fix nonce issues on AJAX requests when closing/reopening tasks