don't unlock already unlocked locks on shutdown
median of an empty report is 0
internal stats, temp_pool size limit and status

- add internal stats
- add status table to show them
- add temp_pool size limit to limit temp pool growth