Bug fixes:

* Release recorder when switching back to photo mode.
* The whole session creation process needs to be in a critical section.