Incrementing a shared variable(C Threaded Programming)