Decrease pthread create retry sleep

If pthread_create call fails, decrease sleep before retry from
1 sec to 0.1 sec
Do msg retry logic at 0.1 sec intervals

rather than 1 sec interval retries
Move state save after scheduling new batch job

This is related to defering batch job scheduling if there
are a bunch of requests pending
Minor code refactoring for performance