Make shared pointers thread-safe

+ SharedPtr casting
Use SharedPtr in concurrent accessors
Replace setChunk by a reference accessor in ChunkGenerator
Merge remote-tracking branch 'refs/remotes/origin/application-base' into application-base