dm thin metadata: Add support for a pre-commit callback