Two fail case fixes from failure injection tests

1. write not block on mutex in shutdown scenario
2. schedule retry of imm write task on failure.