Clean up env_posix.cc.
Clean up env_posix.cc.

General cleanup principles:
* Use override when applicable.
* Remove static when redundant (methods and  globals in anonymous
  namespaces).
* Use const on class members where possible.
* Standardize on "status" for Status local variables.
* Renames where clarity can be improved.
* Qualify standard library names with std:: when possible, to
  distinguish from POSIX names.
* Qualify POSIX names with the global namespace (::) when possible, to
  distinguish from standard library names.

This also refactors the background thread synchronization logic so that
it's statically analyzable.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219212089

dwing4g/leveldb,matehat/leveldb,cmumford/leveldb,dwing4g/leveldb,matehat/leveldb,fastogt/leveldb,bitcoin-core/leveldb,bitcoin-core/leveldb,cmumford/leveldb,likema/leveldb,google/leveldb,bitcoin-core/leveldb,google/leveldb,matehat/leveldb,likema/leveldb,fastogt/leveldb,dwing4g/leveldb