Handling race conditions with redux-thunk