Fixes a concurrent write panic that occurs when you switch pages quickly while in dev mode.
The fix uses a RWMutex to allow multiple template readers, but only one active writer. When not in dev mode, the only write to the templates map is when NewPages -> loadAllTemplates is called. When in dev mode the loadTemplateFromDisk is called and will load items into the templates map.
I have somehow never encountered this, thanks for the submission!